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

types.GenericAlias has extra__copy__ and__deepcopy__ in__dir__ #105487

Open
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-typingtype-bugAn unexpected behavior, bug, or error
@sobolevn

Description

@sobolevn

Repro:

>>> typeA[X]=list[X]>>>dir(A[int])[...,'__copy__','__deepcopy__', ...]

We can access all other attributes, but not__copy__ and__deepcopy__:

>>> A[int].__copy__Traceback (most recent call last):  File"<stdin>", line1, in<module>AttributeError:'types.GenericAlias' object has no attribute '__copy__'. Did you mean: '__doc__'?>>> A[int].__deepcopy__Traceback (most recent call last):  File"<stdin>", line1, in<module>AttributeError:'types.GenericAlias' object has no attribute '__deepcopy__'

I am not quite sure what is the right thing to do here 🤔

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)topic-typingtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp