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

Incorrect description about scope related with inheritance #73196

Closed
wooyoo mannequin opened this issue Dec 19, 2016 · 12 comments
Closed

Incorrect description about scope related with inheritance #73196

wooyoo mannequin opened this issue Dec 19, 2016 · 12 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir easy

Comments

@wooyoo
Copy link
Mannequin

wooyoo mannequin commented Dec 19, 2016

BPO 29010
Nosy @bitdancer, @brendan-donegan, @brendan-donegan

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 = None
closed_at = None
created_at = <Date 2016-12-19.04:45:33.115>
labels = ['easy', '3.11', '3.9', '3.10', 'docs']
title = 'Incorrect description about scope related with inheritance'
updated_at = <Date 2021-11-19.17:34:43.264>
user = 'https://bugs.python.org/wooyoo'

bugs.python.org fields:

activity = <Date 2021-11-19.17:34:43.264>
actor = 'iritkatriel'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2016-12-19.04:45:33.115>
creator = 'woo yoo'
dependencies = []
files = []
hgrepos = []
issue_num = 29010
keywords = ['easy', 'newcomer friendly']
message_count = 12.0
messages = ['283580', '283581', '283596', '283621', '283622', '283623', '283663', '283666', '283667', '283691', '283694', '283696']
nosy_count = 5.0
nosy_names = ['r.david.murray', 'docs@python', 'woo yoo', 'brendan-donegan', 'brendand']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue29010'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 19, 2016

The current description is "The name BaseClassName must be defined in a scope containing the derived class definition", which did not conform to the actual situation ,e.g. the base class object is not in the same scope as the derived class.

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 19, 2016

@wooyoo wooyoo mannequin added the docs Documentation in the Doc dir label Dec 19, 2016
@wooyoo wooyoo mannequin assigned docspython Dec 19, 2016
@brendan-donegan
Copy link
Mannequin

brendan-donegan mannequin commented Dec 19, 2016

Hi. Can you please provide a small code snippet illustrating where this diverges from the actual behaviour?

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 19, 2016

Code:

class A(object):
pass

'object' is not in the same scope as 'A'

@bitdancer
Copy link
Member

It is part of the global scope, which contains all other scopes. (I'm not 100% sure I'm comfortable with that language, but it doesn't seem obviously wrong.)

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 19, 2016

The previous description about scope classify it into 3 types explicitly, which means the scope containing the current module's global names is not same as the scope containing built-in names.

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 20, 2016

If i was wrong about this issue, please tell me.

@brendan-donegan
Copy link
Mannequin

brendan-donegan mannequin commented Dec 20, 2016

IMO there's no actual bug in Python. Perhaps documentation can be clarified
in a short simple way. I would reiterate the point that restating facts of
the language all over the documentation is not a great idea, but maybe here
the benefits outweigh the drawbacks.

Anyway I think the bug is clear now (it's a docs issue if anything) so I'd
leave it open until someone offers a patch or a strong argument why it
shouldn't be clarified.

On Tue, 20 Dec 2016 at 09:18 woo yoo <report@bugs.python.org> wrote:

woo yoo added the comment:

If i was wrong about this issue, please tell me.

----------


Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue29010\>


@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 20, 2016

I agree with you

@bitdancer
Copy link
Member

Would it make it clearer if we said "BaseClassName must be defined in a namespace accessible from the scope containing the dervied class definition" ?

@brendan-donegan
Copy link
Mannequin

brendan-donegan mannequin commented Dec 20, 2016

Worth putting them side by side I think:

"The name BaseClassName must be defined in a scope containing the derived class definition"

vs.

"BaseClassName must be defined in a namespace accessible from the scope containing the derived class definition"

@wooyoo
Copy link
Mannequin Author

wooyoo mannequin commented Dec 20, 2016

As for me, i prefer the new description, which is clear and easy to understand.

@iritkatriel iritkatriel added easy 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes labels Nov 19, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
nanjekyejoannah pushed a commit that referenced this issue Oct 7, 2022
…92840)

Add namespace/scope clarification for inheritance section
@slateny slateny closed this as completed Oct 8, 2022
carljm added a commit to carljm/cpython that referenced this issue Oct 8, 2022
* main: (38 commits)
  pythongh-92886: make test_ast pass with -O (assertions off) (pythonGH-98058)
  pythongh-92886: make test_coroutines pass with -O (assertions off) (pythonGH-98060)
  pythongh-57179: Add note on symlinks for os.walk (python#94799)
  pythongh-94808: Fix regex on exotic platforms (python#98036)
  pythongh-90085: Remove vestigial -t and -c timeit options (python#94941)
  pythonGH-83901: Improve Signature.bind error message for missing keyword-only params (python#95347)
  pythongh-61105: Add default param, note on using cookiejar subclass (python#95427)
  pythongh-96288: Add a sentence to `os.mkdir`'s docstring. (python#96271)
  pythongh-96073: fix backticks in NEWS entry (pythonGH-98056)
  pythongh-92886: [clinic.py] raise exception on invalid input instead of assertion (pythonGH-98051)
  pythongh-97997: Add col_offset field to tokenizer and use that for AST nodes (python#98000)
  pythonGH-88968: Reject socket that is already used as a transport (python#98010)
  pythongh-96346: Use double caching for re._compile() (python#96347)
  pythongh-91708: Revert params note in urllib.parse.urlparse table (python#96699)
  pythongh-96265: Fix some formatting in faq/design.rst (python#96924)
  pythongh-73196: Add namespace/scope clarification for inheritance section (python#92840)
  pythongh-97646: Change `.js` and `.mjs` files mimetype to conform to RFC 9239 (python#97934)
  pythongh-97923: Always run Ubuntu SSL tests with others in CI (python#97940)
  pythongh-97956: Mention `generate_global_objects.py` in `AC How-To` (python#97957)
  pythongh-96959: Update HTTP links which are redirected to HTTPS (python#98039)
  ...
mpage pushed a commit to mpage/cpython that referenced this issue Oct 11, 2022
…tion (python#92840)

Add namespace/scope clarification for inheritance section
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes docs Documentation in the Doc dir easy
Projects
None yet
Development

No branches or pull requests

3 participants