[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan
Change by Guðni Nathan : -- keywords: +patch pull_requests: +16016 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16438 ___ Python tracker <https://bugs.python.org/issu

[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan
Guðni Nathan added the comment: This bug appears to also affect shallow copies and can be reproduced with the following code: >>> import copy >>> obj = property() >>> copy.copy(obj) Traceback (most recent call last): File "", line 1, in

[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan
Guðni Nathan added the comment: Function objects are considered "atomic" here and I believe you can also write to their __doc__ (among other attributes). -- ___ Python tracker <https://bugs.python.o

[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan
Guðni Nathan added the comment: A small change: The fix should go to Lib/copy.py:198, not line 208. -- ___ Python tracker <https://bugs.python.org/issue38

[issue38293] Deepcopying property objects results in unexpected TypeError

2019-09-27 Thread Guðni Nathan
New submission from Guðni Nathan : Currently, attempting to deepcopy a property object will result in an unexpected TypeError: >>> import copy >>> obj = property() >>> new_obj = copy.deepcopy(obj) Traceback (most recent call last): File "", line 1, in