Explicit variable declaration

Filip Gruszczyński gruszczy at gmail.com
Wed Apr 23 05:52:28 EDT 2008


>  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.

-- 
Filip Gruszczyński


More information about the Python-list mailing list