One that I miss very much in dynamical naming of variables. You can easily overcome this problem using dictionaries:
d = {}
d['foo'] = 'bar'
But python names its variables by storing them on a global dictionary named vars(). So you can create a variable by naming it after a string
vars()['foo'] = 'bar'
print foo
I don't know when one might need this, but it is doable.
No comments:
Post a Comment