Skip to content

pathlib ABCs: remove or namespace private attributes #127807

@barneygale

Description

@barneygale

@encukou pointed out:

I see there's currently no distinction between pathlib-internal attribute names and names that are free for third-party subclasses to use.
Should there be a stronger namespace for these, like _pathlib_sep, _pathlib_globber & _pathlib_stack?
Or should _sep & co. be documented so users know to not override them?

PurePathBase and PathBase have ~10 private attributes for facilitating copying, ~3 for matching and globbing, and ~3 more for miscellaneous purposes. We should try to eliminate as many as possible, and namespace the rest (e.g. under _pathlib_)

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