| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
| import warnings | ||
| with warnings.catch_warnings(): | ||
| warnings.simplefilter('ignore', category=DeprecationWarning) | ||
| args, varargs, varkw = getargs(frame.f_code) |
There was a problem hiding this comment.
Maybe we should follow our own advice and use inspect.signature(types.FunctionType(frame.f_code, {})) here? :)
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think so. Right now getargs does some ugly things:
Line 1384 in fef6fb8
I think that we can just keep it as-is and then remove all of them together in 3.15 (because getargvalues will also be deprecated and removed at the same time, PR is just not ready yet).
Sorry, something went wrong.
There was a problem hiding this comment.
Okay, I see. Maybe we should do the getargvalues() deprecation first, though, in that case? It makes me a little uncomfortable adding this deprecation warning now, if we're not able to make the mandated change in our own code yet.
(I'm fine suppressing DeprecationWarnings in a function that is itself deprecated, but getargvalues() isn't, yet. And I know you plan to work on deprecating it immediately after this PR, but if I had a pound for every time somebody promised me they'd work on something the next day, and then discovered it was harder than they expected, I'd be a rich man :)
Sorry, something went wrong.
There was a problem hiding this comment.
Sure, I can open a PR about getargvalues() first 👍
Sorry, something went wrong.
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
There was a problem hiding this comment.
LGTM, thanks! As discussed in https://github.com/python/cpython/pull/112279/files#r1402002908, however, let's deprecate getargvalues() first 👍
Sorry, something went wrong.
|
This PR is stale because it has been open for 30 days with no activity. |
Sorry, something went wrong.
|
@sobolevn: This change has been approved but was never merged. It's now outdated since it mentions Python 3.13. Do you still plan to work on this PR? If not, I suggest closing it. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Following the discussion of #108902, I documented that getargs is deprecated (since it is not documented anywhere, I just modified its docstring) and that inspect.signature(types.FunctionType(co, {})) is the modern alternative. I think that it is safe to remove this function in two versions, because it does not work anyway (pos-only, kw-only params are incorrect).
I also don't think that modernizing getargvalues is valuable, because it will also be deprecated in 3.13 and hopefully removed in 3.15 as well.
CC @AlexWaygood @merwok @vstinner who reviewed the first PR.