Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

typing.TypedDict: unnecessary hasattr check #109543

Closed
Assignees
JelleZijlstra
@JelleZijlstra

Description

@JelleZijlstra

These lines:

https://github.com/python/cpython/blob/412f5e85d6b9f2e90c57c54539d06c7a025a472a/Lib/typing.py#L2889-2890

ifnothasattr(tp_dict,'__total__'):tp_dict.__total__=total

go out of their way to account for the case there a TypedDict already has a__total__ attribute. But I don't think there is any way for the TypedDict to have that attribute at this point. For clarity, we should remove the check.

Linked PRs

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp