| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
|
An alternative solution, closer to the original code, would be def _have_code_flag(func, flag):
"""Return true if the function ``func`` has a code object with
``flag`` in its flags."""
if ismethod(func):
func = func.__func__
return isfunction(func) and bool(code.co_flags & flag) |
Sorry, something went wrong.
|
The isgeneratorfunction docstring now says: Generator function objects provide the same attributes as functions. See help(isfunction) for a list of attributes I don't think the PR as it is (i.e. checking for __code__) gives a strong enough guarantee for that. It's not apparent that __code__ is reserved for functions only. I'm worried about us adding __code__ to something unrelated in the future, without regard to how inspect uses it. So I'm leaning towards the alternative solution, keeping the isfunction/ismethod calls. |
Sorry, something went wrong.
|
I updated the branch with explit ismethod and isfunction checks. |
Sorry, something went wrong.
|
Branch rebased to latest master. Please review... |
Sorry, something went wrong.
|
CC @1st1 as suggested by https://devguide.python.org/experts/ |
Sorry, something went wrong.
There was a problem hiding this comment.
I am OK with this implementation.
Sorry, something went wrong.
So, are you willing to actually merge it (or add the automerge label)? |
Sorry, something went wrong.
|
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request. |
Sorry, something went wrong.
|
I have made the requested changes; please review again. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
https://bugs.python.org/issue33261