Skip to content

Clarify module.__file__ documentation in the data model reference #150274

@RaghunandanKumar

Description

@RaghunandanKumar

Documentation

The module.__file__ section in Doc/reference/datamodel.rst has two problems:

  • it says "Both attributes should be a str" even though the section is describing a single attribute
  • it does not clearly explain the path form readers should expect from __file__

The docs should say that __file__ is optional, should be a str when set, and is usually an absolute path for modules loaded from a file by the import system, while callers that require an absolute path should normalize it explicitly.

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir
    No fields configured for issues without a type.

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions