FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Doc: Namespace Packages: Inconsistent documentation of __loader__ being None · Issue #79362 · python/cpython · GitHub

Repository navigation

Doc: Namespace Packages: Inconsistent documentation of __loader__ being None #79362

Closed

Description

BPO 35181
Nosy @warsaw, @brettcannon, @ncoghlan, @ericvsmith, @ericsnowcurrently, @JulienPalard, @csabella, @maggyero, @miss-islington
PRs
  • bpo-35181: Correct an assumption about the namespace package loader attribute #10376
  • bpo-37800: Clean up importlib documentation for some module attributes #10016
  • bpo-35181: Correct importlib documentation for some module attributes #15190
  • [3.9] bpo-35181: Correct importlib documentation for some module attributes (GH-15190) #22872
  • [3.8] bpo-35181: Correct importlib documentation for some module attributes (GH-15190) #22873
  • 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:

    assignee = 'https://github.com/warsaw'
    closed_at = None
    created_at = <Date 2018-11-06.22:29:09.600>
    labels = ['type-feature', '3.8', '3.9', '3.10', 'docs']
    title = 'Doc: Namespace Packages: Inconsistent documentation of __loader__ being None'
    updated_at = <Date 2020-10-24.03:04:47.832>
    user = 'https://github.com/JulienPalard'

    bugs.python.org fields:

    activity = <Date 2020-10-24.03:04:47.832>
    actor = 'maggyero'
    assignee = 'barry'
    closed = False
    closed_date = None
    closer = None
    components = ['Documentation']
    creation = <Date 2018-11-06.22:29:09.600>
    creator = 'mdk'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35181
    keywords = ['patch']
    message_count = 12.0
    messages = ['329392', '329419', '339814', '341173', '346316', '346317', '379227', '379253', '379254', '379256', '379260', '379512']
    nosy_count = 10.0
    nosy_names = ['barry', 'brett.cannon', 'ncoghlan', 'eric.smith', 'docs@python', 'eric.snow', 'mdk', 'cheryl.sabella', 'maggyero', 'miss-islington']
    pr_nums = ['10376', '10016', '15190', '22872', '22873']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35181'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    Activity

    1. JulienPalard commented on Nov 6, 2018

      MemberAuthor

      The documentation states that a __loader__ of a namespace package should be None:

      • 1 "For namespace packages this should be set to None."
      • 2 "To indicate to the import machinery that the spec represents a namespace portion. the path entry finder sets “loader” on the spec to None".

      But this looks wrong 3, looks like it has been changed in 4/5.

      I think one should rely on __file__ being None on namespace packages (which make sense as they span over multiple directories) instead of __loader__ being None (a side effect of the import machinery ?).

    2. maggyero commented on Nov 7, 2018

      maggyeromannequin
      Mannequin

      It looks like Barry Warsaw has not been fully updated the documentation after making the __spec__.loader attribute match with the __loader__ attribute, and the __spec__.file attribute match with the __file__ attribute for namespace packages.

      Here is a pull request to update the library documentation of importlib (your first link [1]) with the current Barry's implementation:
      #10016

      Here is another pull request to update the reference documentation of the import system (your second link [2], but for a different paragraph, as I think the "To indicate to the import machinery that the spec represents a namespace portion the path entry finder sets “loader” on the spec to None" sentence is correct, since the _bootstrap.ModuleSpec.loader attribute of a namespace package remains None until the call to the importlib._bootstrap._init_module_attrs function):
      #10376

    3. csabella commented on Apr 9, 2019

      Contributor

      @barry, you started a review of PR10016 and I believe all your requested changes have been made, so please review again when you get a chance. Please also take a look at PR10376. Thanks!

    4. warsaw commented on May 1, 2019

      Member

      I've approved both PRs, however I am rather uncomfortable about the code snippet in import.rst. Géry's change is a good one AFAICT, and thanks for the contribution! I would feel much better about the long term correctness of this code snippet if we had a doctest to run over it. But that's for another time.

    5. maggyero commented on Jun 23, 2019

      maggyeromannequin
      Mannequin

      @julien, @barry

      Now that the PRs are merged, I think that we can close this issue.

    6. maggyero commented on Jun 23, 2019

      maggyeromannequin
      Mannequin

      Oops, sorry, only one of the two PRs has been merged.

    7. warsaw commented on Oct 21, 2020

      Member

      Apologies for the long delay in reviewing this bug. I'm looking at it now, however since Python 3.7 is in security-only mode, this will only apply to 3.10, 3.9, and 3.8.

    8. miss-islington commented on Oct 21, 2020

      Contributor

      New changeset 27f1bd8 by Géry Ogam in branch 'master':
      bpo-35181: Correct importlib documentation for some module attributes (GH-15190)
      27f1bd8

    9. miss-islington commented on Oct 21, 2020

      Contributor

      New changeset 916ac95 by Miss Skeleton (bot) in branch '3.8':
      bpo-35181: Correct importlib documentation for some module attributes (GH-15190)
      916ac95

    10. miss-islington commented on Oct 21, 2020

      Contributor

      New changeset 6e842bc by Miss Skeleton (bot) in branch '3.9':
      bpo-35181: Correct importlib documentation for some module attributes (GH-15190)
      6e842bc

    11. warsaw commented on Oct 21, 2020

      Member

      @maggyero - I haven't merged PR 10016, but I left some additional comments. Are you still interested in shepherding this PR?

    12. maggyero commented on Oct 24, 2020

      maggyeromannequin
      Mannequin

      Thanks @barry for reviewing and merging PR 15190

      I haven't merged PR 10016, but I left some additional comments. Are you still interested in shepherding this PR?

      Also thanks for helping me with @ericsnowcurrently advancing this last PR. Yes I am still interested, I have reviewed all the comments and updated the whole thing, doing my best to keep the two descriptions of the module attributes and spec attributes consistent since this PEP updates both descriptions.

    13. transferred this issue fromon Apr 10, 2022
    14. warsaw commented on Apr 27, 2022

      Member

      #15190 has been merged, so I believe all issues mentioned in this issue have been resolved. The issue just never got closed, so closing it now. Please follow up here or open a new issue and @ mention me if anyone thinks otherwise. Thanks for all the contributions.

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

    Metadata

    Metadata

    Assignees

    Labels

    3.10 (EOL)end of life3.8 (EOL)end of life3.9 (EOL)end of lifedocsDocumentation in the Doc dirtype-featureA feature request or enhancement

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions


      Back | FazBrowse Home | New Git URL