-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
inspect documentation describes module type inaccurately #65959
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
In the documentation for the inspect module, the module type is described with just 2 of its potential 7 attributes. The language reference[2] and importlib docs[3] both provide an accurate list of module attributes. Furthermore, the description for __file__ should be fixed. It should be clear that __file__ reflects the location from which the module was loaded, that location is not necessarily a filename, and the attribute may not exist if the module was not loaded from a specific location (e.g. builtin and frozen modules). The same goes for __cached__ [1] https://docs.python.org/dev/library/inspect.html#types-and-members |
I sent a PR to fix a __file__ description. |
PR has been sent. |
I've merged the changes for __file__. Thanks, furkanonder! The fixes in the types module remain to be done, though now I see 4 of the relevant attributes instead of 2. (missing: __path__, __file__, __cached__) |
@encukou I believe this ticket is no longer relevant. There was a change in https://github.com/python/cpython/pull/98116/files where the module members were removed from https://docs.python.org/dev/library/inspect.html#types-and-members, that this ticket suggested to update. There's no longer nothing to update, because we're simply referencing another docs location for the details. I assume that other location is correct and covers all the fields. That was also the assumption in the original report in this ticket:
[2] https://docs.python.org/3/reference/import.html#import-related-module-attributes (it's now linked to this) |
I agree. Thank you for triaging! |
As #65959 (comment) notes, there are also some missing attributes in the |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: