Skip to content
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

Merged
merged 2 commits into from
May 24, 2024
Merged

Conversation

AlexWaygood
Copy link
Member

No description provided.

This comment has been minimized.

@@ -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: ...
Copy link
Member

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

Copy link
Member Author

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.

Copy link
Member

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): ...
Copy link
Member

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
Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@AlexWaygood AlexWaygood merged commit fc33ba6 into python:main May 24, 2024
63 checks passed
@AlexWaygood AlexWaygood deleted the builtins-py313 branch May 24, 2024 19:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants