Guido van Rossum, 10.04.2014 03:08: > - Jukka Lehtosalo gave a talk and answered questions about mypy, his design > and implementation of pragmatic type annotations (no new syntax required, > uses Python 3 function annotations).
FWIW, signature type annotations aren't enough for a static compiler like Cython, which also benefits from local and global variable declarations, static functions, etc. However, we initially discussed this feature in the project some five years ago or so and never actually implemented it, so I finally decided to add support for it to Cython. There already was a way to provide static Cython/C type declarations in pure Python code, also for function arguments, but it's nice to have a way that is also naturally runtime inspectable in the signature. It essentially looks like this now: def func(plain_python_type: dict, named_python_type: 'list', explicit_python_type: {'type': dict}, explicit_named_python_type: {'type': 'tuple'}, explicit_c_type: {'ctype': 'int'}): ... Pretty straight forward, I think. Stefan _______________________________________________ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com