Skip to content

Instantly share code, notes, and snippets.

@mnot mnot/example.py
Created Mar 22, 2017

Embed
What would you like to do?
This dies in a fire on 3.5.2, works on 3.6.
#!/usr/bin/env python
from typing import Optional, Type
class Foo(object):
pass
class Bar(Foo):
pass
def test_me() -> Optional[Type[Foo]]:
print("Hi there!")
return Bar
if __name__ == "__main__":
test_me()
@jeamland

This comment has been minimized.

Copy link

commented Mar 22, 2017

Also works on 3.5.3:

benno@bjrbsd ~> uname -a
FreeBSD bjrbsd 12.0-CURRENT FreeBSD 12.0-CURRENT #3 r310121: Fri Dec 16 18:50:43 PST 2016     benno@bjrbsd:/src/obj/src/freebsd/sys/GENERIC-NODEBUG  amd64
benno@bjrbsd ~> python3 --version
Python 3.5.3
benno@bjrbsd ~> python3 tt.py
Hi there!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.