On Apr 23, 4:52 pm, "Filip Gruszczyński" <[EMAIL PROTECTED]> wrote: > > You mean the type? Not in 2.x, but in 3.x, there are function > > annotations: > > > def a_function(arg1: int, arg2: str) -> None: pass > > Nope, I don't like types ;-) 3.x seems pretty revolutionary, and this > typing can be appreciated by some people. > > > Declaring what about them? If you mean declaring the type, remember > > that Python deliberately allows any name to be bound to any object; > > type declarations can't be enforced without losing a lot of the power > > of Python. > > Just declaring, that they exist. Saying, that in certain function > there would appear only specified variables. Like in smalltalk, if I > remember correctly.
If you want to just declare that name exist, but doesn't want to declare the type, why don't you just do this: def somefunc(): nonlocal = nonlocal local = 0 # or None or [] or an initial value # return nonlocal * local -- http://mail.python.org/mailman/listinfo/python-list