I provided a decorator recipe to do just what Chris Angelico describes a year or two before PEP 484 described static typechecking.  I think what I do is a consistent subset of PEP 484 still, modulo the difference between runtime and static.

See: http://code.activestate.com/recipes/578528-type-checking-using-python-3x-annotations/

It would be a lot more work to do everything the typing.py module and PEP 484 describes (algebraic typing, basically), but it's all just code that is compatible back to Python 3.0.

On Fri, Jul 8, 2016 at 3:34 AM, Paul Moore <p.f.moore@gmail.com> wrote:
On 8 July 2016 at 10:35, Chris Angelico <rosuav@gmail.com> wrote:
>> Anyway, I just throw an idea to here. Greet to all of you for bring
>> Python to me.
> Keep on throwing ideas this way! Ideas are great. Well-thought-out
> ideas make for interesting discussions, even if they don't get
> implemented. Often the answer ends up being "here's a way to do this
> with the current version", but it doesn't carry with it a tag of "and
> you're an idiot for even suggesting it". We like ideas here -
> otherwise we wouldn't subscribe to this list :)

Agreed! I'd have never even thought of Chris' decorator approach
before this discussion occurred, so thanks for raising the subject. I
may never use it, but knowing how to do something like this is great.

Python-ideas mailing list
Code of Conduct: http://python.org/psf/codeofconduct/

Keeping medicines from the bloodstreams of the sick; food
from the bellies of the hungry; books from the hands of the
uneducated; technology from the underdeveloped; and putting
advocates of freedom in prisons.  Intellectual property is
to the 21st century what the slave trade was to the 16th.