bpo-28869: Skip one additional frame when type.__new__ is called not directly from type.__call__.#14166
bpo-28869: Skip one additional frame when type.__new__ is called not directly from type.__call__.#14166serhiy-storchaka wants to merge 8 commits into
Conversation
* Move handling of one-argument call of type() from type.__new__() to type.__call__(). * Move deducing __module__ from the caller's frame from type.__new__() to type.__call__().
94ab8b0 to
6b14bb1
Compare
June 17, 2019 19:12
|
@serhiy-storchaka I like this approach, please let me know when this is ready for review (I assume tests are needed and some comments explaining this behavior). |
Sorry, something went wrong.
|
Yes, it needs tests and documenting. Also this PR contains actually two changes. I am not sure that both of them should be backported, but it is difficult to make one without making other. |
Sorry, something went wrong.
|
I just have tested, and seems there is no undesired behavior change. So I just need to write tests and a NEWS entry. |
Sorry, something went wrong.
|
Unfortunately it does not work. Not setting |
Sorry, something went wrong.
ilevkivskyi
left a comment
There was a problem hiding this comment.
I have one question/comment. Also if we are going this way, I think this deserves a comment in the code explaining the motivation.
Sorry, something went wrong.
|
It looks like this may also fix https://bugs.python.org/issue37948 |
Sorry, something went wrong.
|
I am not sure it is a good solution. |
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
https://bugs.python.org/issue28869