Skip to content

types.LazyImportType has no __name__ proprety #16343

Description

@Viicos

Currently:

typeshed/stdlib/types.pyi

Lines 611 to 615 in 5b9d624

@final
class LazyImportType:
@property
def __name__(self) -> str: ...
def resolve(self) -> Any: ...

But (on 3.15.0rc2):

import sys

lazy import abc

lazy_import = sys.modules[__name__].__dict__['abc']
lazy_import
#> <lazy_import 'abc'>
lazy_import.__name__
#> AttributeError: cannot access attribute '__name__' on unresolved lazy import 'abc'. Did you mean '.__ne__' instead of '.__name__'?

Can send PR.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions