Explicit variable declaration

Filip Gruszczyński gruszczy at gmail.com
Wed Apr 23 21:29:54 EDT 2008


>  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

Err.. I don't quite get. How it may help me? Could you explain?

-- 
Filip Gruszczyński


More information about the Python-list mailing list