"no variable or argument declarations are necessary."
Paul Rubin
http
Wed Oct 5 05:35:15 EDT 2005
Brian Quinlan <brian at sweetapp.com> writes:
> > Python already has a "global" declaration;
>
> Which is evaluated at runtime, does not require that the actual global
> variable be pre-existing, and does not create the global variable if
> not actually assigned. I think that is pretty different than your
> proposal semantics.
Different how?
> Your making this feature "optional" contradicts the subject of this
> thread i.e. declarations being necessary.
They're necessary if you enable the option.
> But, continuing with your declaration thought experiment, how are
> you planning on actually adding optional useful type declarations to
> Python e.g. could you please rewrite this (trivial) snippet using
> your proposed syntax/semantics?
def do_add(x->str, y->str):
return '%s://%s' % (x, y)
def do_something(node->Node):
if node.namespace == XML_NAMESPACE:
return do_add('http://', node.namespace)
elif node.namespace == ...
More information about the Python-list
mailing list