Date: Wed, 3 Aug 2016 16:53:55 -0700 From: Guido van Rossum
On Wed, Aug 3, 2016 at 3:02 PM, Pavol Lisy email@example.com wrote:
def fnc(): global a: list
I'm not proposing to add such syntax, and the right place for the type of a would be at the global level, not on the `global` syatement.
If 'a' is only read, it looks like a sensible way to state that this function should be called only when 'a' is a list. It's not the same as a global type declaration. More like a parameter type hint.
If 'a' is written to, it is very similar to the 'if else' example.
(which, if I may add, is usually defined as the meet of the assertions. If we talk about abstract interpretation frameworks)