Title: Possible small mistake in the documentation of importlib.util.LazyLoader.factory · Issue #101390 · python/cpython · GitHub
Open Graph Title: Possible small mistake in the documentation of importlib.util.LazyLoader.factory · Issue #101390 · python/cpython
X Title: Possible small mistake in the documentation of importlib.util.LazyLoader.factory · Issue #101390 · python/cpython
Description: The documentation of LoazyLoader.factory in the module importlib.util says: classmethod factory(loader) A static method which returns a callable that creates a lazy loader. This is meant to be used in situations where the loader is passe...
Open Graph Description: The documentation of LoazyLoader.factory in the module importlib.util says: classmethod factory(loader) A static method which returns a callable that creates a lazy loader. This is meant to be used...
X Description: The documentation of LoazyLoader.factory in the module importlib.util says: classmethod factory(loader) A static method which returns a callable that creates a lazy loader. This is meant to be used...
Opengraph URL: https://github.com/python/cpython/issues/101390
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Possible small mistake in the documentation of importlib.util.LazyLoader.factory","articleBody":"The \u003cu\u003edocumentation\u003c/u\u003e of _LoazyLoader_.**factory** in the module _importlib.util_ says:\r\n\r\n\u003e **classmethod** factory(loader)\r\n\u003e\r\n\u003e A **static 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.\r\n\r\nThe problem is that there is a mixing of words **classmethod** and **static method**. And the [documentation](https://docs.python.org/3/reference/datamodel.html#types) defines the _static method_ as \u003cq\u003e... Static method objects are created by the built-in staticmethod() constructor.\u003c/q\u003e\r\n\r\nThe source code for the method is:\r\n\r\n```python\r\n@classmethod\r\ndef factory(cls, loader):\r\n \"\"\"Construct a callable which returns the eager loader made lazy.\"\"\"\r\n cls.__check_eager_loader(loader)\r\n return lambda *args, **kwargs: cls(loader(*args, **kwargs))\r\n```\r\n\r\nSo, in my opition, \"a static method\" in the documentation should be corrected to \"a class method\".\r\n\r\nI've created the PR in case the issue is right.\r\n\r\n\u003c!-- gh-linked-prs --\u003e\r\n### Linked PRs\r\n* gh-101391\r\n* gh-101813\n* gh-101814\n\u003c!-- /gh-linked-prs --\u003e\r\n","author":{"url":"https://github.com/busywhitespace","@type":"Person","name":"busywhitespace"},"datePublished":"2023-01-28T13:08:43.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/101390/cpython/issues/101390"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:9a0da417-f9ad-7690-2dc5-c45c437e696c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | DB82:347527:746921:A2FFBD:696A1392 |
| html-safe-nonce | 286587b7200b4925ed23f609768c0d1f3e46e0cfacc18cec63082b2f4eea975f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEQjgyOjM0NzUyNzo3NDY5MjE6QTJGRkJEOjY5NkExMzkyIiwidmlzaXRvcl9pZCI6IjYzMTU3NjUwMDk4NTc3Nzg1NzgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 2e59a93a5ac8c63672ab300a9cbd5db8f0a5bc08c7c642fe75cfabc730c1a9c6 |
| hovercard-subject-tag | issue:1560852125 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/101390/issue_layout |
| twitter:image | https://opengraph.githubassets.com/300e7d6c6399ad045db3684e4794d9d1367d6900c3a851ed0c9ad2bc0903da26/python/cpython/issues/101390 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/300e7d6c6399ad045db3684e4794d9d1367d6900c3a851ed0c9ad2bc0903da26/python/cpython/issues/101390 |
| og:image:alt | The documentation of LoazyLoader.factory in the module importlib.util says: classmethod factory(loader) A static method which returns a callable that creates a lazy loader. This is meant to be used... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | busywhitespace |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width