On 05/09/16 14:46, Nick Coghlan wrote: > That's not what the PEP proposes for uninitialised variables though: > it proposes processing them *before* a series of assignment > statements, which *only makes sense* if you plan to use them to > constrain those assignments in some way. > > If you wanted to write something like that under a type assertion > spelling, then you could enlist the aid of the "all" builtin: > > assert all(x) : List[T] # All local assignments to "x" must abide > by this constraint > if case1: > x = ... > elif case2: > x = ... > else: > x = ... > Would the `assert all(x)` be executed at runtime as well or would this be syntax only for type checkers? I think this particular spelling at least is potentially confusing. Regards, Ian F -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 473 bytes Desc: OpenPGP digital signature URL: <http://mail.python.org/pipermail/python-dev/attachments/20160905/27750b9f/attachment.sig>
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4