Skip to content
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

ast module docs document private attribute #47402

Closed
brettcannon opened this issue Jun 20, 2008 · 4 comments
Closed

ast module docs document private attribute #47402

brettcannon opened this issue Jun 20, 2008 · 4 comments
Assignees
Labels
docs Documentation in the Doc dir easy type-bug An unexpected behavior, bug, or error

Comments

@brettcannon
Copy link
Member

BPO 3152
Nosy @loewis, @brettcannon, @birkenfeld, @rhettinger

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/birkenfeld'
closed_at = <Date 2008-06-20.21:59:49.440>
created_at = <Date 2008-06-20.20:36:33.052>
labels = ['easy', 'type-bug', 'docs']
title = 'ast module docs document private attribute'
updated_at = <Date 2008-06-20.21:59:49.388>
user = 'https://github.com/brettcannon'

bugs.python.org fields:

activity = <Date 2008-06-20.21:59:49.388>
actor = 'loewis'
assignee = 'georg.brandl'
closed = True
closed_date = <Date 2008-06-20.21:59:49.440>
closer = 'loewis'
components = ['Documentation', 'None']
creation = <Date 2008-06-20.20:36:33.052>
creator = 'brett.cannon'
dependencies = []
files = []
hgrepos = []
issue_num = 3152
keywords = ['easy', '26backport']
message_count = 4.0
messages = ['68473', '68474', '68476', '68480']
nosy_count = 4.0
nosy_names = ['loewis', 'brett.cannon', 'georg.brandl', 'rhettinger']
pr_nums = []
priority = 'critical'
resolution = 'wont fix'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3152'
versions = ['Python 2.6', 'Python 3.0']

@brettcannon
Copy link
Member Author

The docs for the ast module document the '_fields' attribute on AST
instances. Either that documentation needs to go away or the attribute
needs to be renamed as the leading underscore means it is private to the
internal API.

@brettcannon brettcannon added docs Documentation in the Doc dir easy type-bug An unexpected behavior, bug, or error labels Jun 20, 2008
@birkenfeld
Copy link
Member

I disagree. The AST classes are auto-generated, the leading underscore
of _fields is there to avoid clashes with field names from the AST types.

This is similar to
http://docs.python.org/dev/library/collections#collections.somenamedtuple.\_fields
which shouldn't be renamed, but isn't private either.

@rhettinger
Copy link
Contributor

This is consistent with the methods in named tuples (also to avoid name
clashes).

@loewis
Copy link
Mannequin

loewis mannequin commented Jun 20, 2008

I agree with Georg and Raymond, closing this as "won't fix".

@loewis loewis mannequin closed this as completed Jun 20, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir easy type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants