[issue28002] ast.unparse can't roundtrip some f-strings

2020-04-19 Thread Simon Percivall
Simon Percivall added the comment: Any and all code from astunparse is certainly available for inclusion. Go ahead. -- nosy: +simon.percivall ___ Python tracker <https://bugs.python.org/issue28

[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-11 Thread Simon Percivall
Simon Percivall added the comment: It think it's important to document this caveat in `get_type_hints`, that there is virtually _no_ way to use it safely with a class, and that there will always be a high risk of getting an exception unless using this function in a highly controlled setting

[issue29966] typing.get_type_hints doesn't really work for classes with ForwardRefs

2017-04-03 Thread Simon Percivall
New submission from Simon Percivall: For classes with ForwardRef annotations, typing.get_type_hints is unusable. As example, we have two files: a.py: class Base: a: 'A' class A: pass b.py: from a import Base class MyClass(Base): b: 'B' class B: pass >>> from typi

[issue29167] Race condition in enum.py:_decompose()

2017-01-07 Thread Simon Percivall
Simon Percivall added the comment: Run this a couple of times (it fails for me the first time, but it's a race, so YMMV): ``` import enum from concurrent.futures import ThreadPoolExecutor class MyEnum(enum.IntFlag): one = 1 with ThreadPoolExecutor() as executor: print(list

[issue29167] Race condition in enum.py:_decompose()

2017-01-05 Thread Simon Percivall
New submission from Simon Percivall: When called by `_create_pseudo_member_()`, the dictionary iteration of `_value2member_map` in `_decompose()` in enum.py may lead to a "RuntimeError: dictionary changed size during iteration". For me, it happened in `re.compile`. ``` Traceback (m

[issue2074] pprint._safe_repr() unsafe on ordering differently types objects with same str represenation

2008-03-18 Thread Simon Percivall
Simon Percivall [EMAIL PROTECTED] added the comment: It's still a problem, as the test case demonstrates. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue2074 __ ___ Python-bugs

[issue2074] pprint._safe_repr() unsafe on ordering differently types objects with same str represenation

2008-02-11 Thread Simon Percivall
New submission from Simon Percivall: _safe_repr() tries to handle the case where two objects are unorderable by ordering on (str(type(key)), key, value), but this fails when str(type(key)) is equal for two objects, but key is different and unorderable. Easy fix: order just on the string

[issue1358] Compile error on OS X 10.5

2007-11-22 Thread Simon Percivall
Simon Percivall added the comment: It has to do with the MACOSX_DEPLOYMENT_TARGET. If it's set to 10.4, the legacy version of setpgrp is used (with args), it it's 10.5, setpgrp expects no arguments. It seems configure won't detect the difference. -- nosy: +percivall