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

Possible small mistake in the documentation of importlib.util.LazyLoader.factory #101390

Closed
Labels
@busywhitespace

Description

@busywhitespace

The documentation ofLoazyLoader.factory in the moduleimportlib.util says:

classmethod factory(loader)

Astatic method which returns a callable that creates a lazy loader. This is meant to be used in situations where the loader is passed by class instead of by instance.

The problem is that there is a mixing of wordsclassmethod andstatic method. And thedocumentation defines thestatic method as... Static method objects are created by the built-in staticmethod() constructor.

The source code for the method is:

@classmethoddeffactory(cls,loader):"""Construct a callable which returns the eager loader made lazy."""cls.__check_eager_loader(loader)returnlambda*args,**kwargs:cls(loader(*args,**kwargs))

So, in my opition, "a static method" in the documentation should be corrected to "a class method".

I've created the PR in case the issue is right.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp