-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
builtins: updates for py313 #12028
builtins: updates for py313 #12028
Conversation
This comment has been minimized.
This comment has been minimized.
stdlib/builtins.pyi
Outdated
@@ -461,7 +461,11 @@ class str(Sequence[str]): | |||
def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... | |||
@overload | |||
def format(self, *args: object, **kwargs: object) -> str: ... | |||
def format_map(self, map: _FormatMapMapping) -> str: ... | |||
if sys.version_info >= (3, 13): | |||
def format_map(self, /, mapping: _FormatMapMapping) -> str: ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure?
% ./python.exe
Python 3.14.0a0 (heads/pep649-inspect-dirty:f9b395687e, May 24 2024, 10:50:24) [Clang 14.0.0 (clang-1400.0.29.202)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> "x".format_map(mapping={})
Traceback (most recent call last):
File "<python-input-0>", line 1, in <module>
"x".format_map(mapping={})
~~~~~~~~~~~~~~^^^^^^^^^^^^
TypeError: str.format_map() takes no keyword arguments
Apparently the docstring says it's a pos-or-keyword, but that's a lie; it's defined as METH_O and therefore takes only a positional argument. https://github.com/python/cpython/blob/cc38ee1edb029d7a9d2c39f8eac0bdff74549988/Objects/unicodeobject.c#L13537
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gah... serves me right for believing stubtest, I suppose? We'd better fix that upstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -2057,3 +2074,7 @@ if sys.version_info >= (3, 11): | |||
def split( | |||
self, condition: Callable[[_ExceptionT_co | Self], bool], / | |||
) -> tuple[ExceptionGroup[_ExceptionT_co] | None, ExceptionGroup[_ExceptionT_co] | None]: ... | |||
|
|||
if sys.version_info >= (3, 13): | |||
class IncompleteInputError(SyntaxError): ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -1214,6 +1224,9 @@ class property: | |||
fset: Callable[[Any, Any], None] | None | |||
fdel: Callable[[Any], None] | None | |||
__isabstractmethod__: bool | |||
if sys.version_info >= (3, 13): | |||
__name__: str |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't in https://docs.python.org/3.13/whatsnew/3.13.html, it probably should be.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
No description provided.