dropbox / pyannotate

Auto-generate PEP-484 annotations
Apache License 2.0
1.43k stars 59 forks source link

Fix a pyannotate crash on code using `pytz` #41

Closed rowillia closed 6 years ago

rowillia commented 6 years ago

pytz creates classes with the name of the timezone being used: https://github.com/stub42/pytz/blob/f55399cddbef67c56db1b83e0939ecc1e276cf42/src/pytz/tzfile.py#L120-L123 This causes pyannotates to crash as it's invalid to have a class name with a / in it (e.g. "pytz.tzfile.America/Los_Angeles")

gvanrossum commented 6 years ago

I already fixed that in ed74a2a, hence the merge conflict, but I like your refinement of using datetime.tzinfo. Can you merge the conflict?

rowillia commented 6 years ago

@gvanrossum Ah sorry I rebased instead of merged. Will merge next time!