On Fri, Mar 1, 2013, at 11:55, 김용빈 wrote:
why we bother with '{variable}'.format(variable=variable) ? can we just '{variable}.format()' ?
if variable is exist, then assign it. if variable is not exist, then raise error
I am not language expert. so sorry if this is not a good idea, or already discussed.
_______________________________________________
Python-ideas mailing list
[1]Python-ideas@python.org
[2]http://mail.python.org/mailman/listinfo/python-ideas
If you don't want to repeat a name multiple times, just use '{0}'.format(variable)
The format function doesn't (i think?) have a way to see your local variables to look up the name.
References
1. mailto:Python-ideas@python.org 2. http://mail.python.org/mailman/listinfo/python-ideas