| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Sorry, something went wrong.
…-string input This also changes parsing of the private `__text_signature__` attribute by inspect.signature(). Now we accept here only types, valid for ast.Constant().
| _type_Ellipsis = type(...) | ||
|
|
||
|
|
||
| def _convert_literal(node, omit_validation=False): |
There was a problem hiding this comment.
Why do we need this change? It may make life harder for some users.
Sorry, something went wrong.
There was a problem hiding this comment.
Could you be more precise, any example?
We need this, because literal_eval() accepts invalid AST for non-string input. Per documentation:
The string or node provided may only consist of the following Python literal structures: strings, bytes, numbers, tuples, lists, dicts, sets, booleans, None and Ellipsis.
Sorry, something went wrong.
There was a problem hiding this comment.
Based on case from stdlib (_signature_fromstr()), I think that possible cases of using this undocumented feature are rare, if exist at all.
Though, we can properly deprecate old behavior for extra safety.
Sorry, something went wrong.
Documentation build overview439 files changed · ± 422 modified · - 17 deleted ± Modified
- Deleted |
Sorry, something went wrong.
previously IntEnum was rendered as 2. I think we should rather preserve repr for int's subclass, like pure-Python methods do. see also python#61005
|
I can split out sentinel support to a separate pr. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Also support sentinel in the literal_eval().
This also changes parsing of the private __text_signature__ attribute by inspect.signature(). Now we accept here only types, valid for ast.Constant().
The signature of _thread.interrupt_main() was marked as unsupported. I think it's a reasonable regression. Previously it was rendered with 2 as default. I think we should rather preserve repr for int's subclasses, like pure-Python methods do. See also #61005.