python / typed_ast

Modified fork of CPython's ast module that parses `# type:` comments
Other
227 stars 54 forks source link

Use PyUnicode_DecodeUnicodeEscape directly #172

Closed srittau closed 2 years ago

hauntsaninja commented 2 years ago

Thanks! In general, I think typed-ast tries to avoid changes to the original source. See my comment on https://github.com/python/typed_ast/pull/171#issuecomment-965648695 , I think this only results in different, but slightly more consistent behaviour across Python versions in a situation in which probably no one will ever use typed-ast (and in which typed-ast is already inconsistent across Python versions). So not sure whether this is worth it.

hauntsaninja commented 2 years ago

Let me know what you think and then I'll make a release accordingly.

srittau commented 2 years ago

By now, I don't think we need to stay close to the original code, since that is dead anyway. I believe that this change could avoid problems when _PyUnicode_DecodeUnicodeEscape is defined by Python (as it obviously was prior to the latest 3.9 release).