This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Incorrect description about scope related with inheritance
Type: Stage:
Components: Documentation Versions: Python 3.11, Python 3.10, Python 3.9
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: brendan-donegan, brendand, docs@python, r.david.murray, woo yoo
Priority: normal Keywords: easy, newcomer friendly

Created on 2016-12-19 04:45 by woo yoo, last changed 2022-04-11 14:58 by admin.

Messages (12)
msg283580 - (view) Author: woo yoo (woo yoo) Date: 2016-12-19 04:45
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.
msg283581 - (view) Author: woo yoo (woo yoo) Date: 2016-12-19 04:46
The associated link is https://docs.python.org/3.6/tutorial/classes.html#inheritance
msg283596 - (view) Author: Brendan Donegan (brendan-donegan) * Date: 2016-12-19 08:38
Hi. Can you please provide a small code snippet illustrating where this diverges from the actual behaviour?
msg283621 - (view) Author: woo yoo (woo yoo) Date: 2016-12-19 13:15
Code:
>class A(object):
    pass

'object' is not in the same scope as 'A'
msg283622 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-19 13:20
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.)
msg283623 - (view) Author: woo yoo (woo yoo) Date: 2016-12-19 14:00
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.
msg283663 - (view) Author: woo yoo (woo yoo) Date: 2016-12-20 03:48
If i was wrong about this issue, please tell me.
msg283666 - (view) Author: Brendan Donegan (brendand) Date: 2016-12-20 04:38
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>
> _______________________________________
>
msg283667 - (view) Author: woo yoo (woo yoo) Date: 2016-12-20 05:18
I agree with you
msg283691 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2016-12-20 14:35
Would it make it clearer if we said "BaseClassName must be defined in a namespace accessible from the scope containing the dervied class definition" ?
msg283694 - (view) Author: Brendan Donegan (brendan-donegan) * Date: 2016-12-20 14:49
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"
msg283696 - (view) Author: woo yoo (woo yoo) Date: 2016-12-20 14:57
As for me, i prefer the new description, which is clear and easy to understand.
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73196
2021-11-19 17:34:43iritkatrielsetkeywords: + easy, newcomer friendly
versions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.5, Python 3.6
2016-12-20 14:57:49woo yoosetmessages: + msg283696
2016-12-20 14:49:45brendan-donegansetmessages: + msg283694
2016-12-20 14:35:15r.david.murraysetmessages: + msg283691
2016-12-20 05:18:29woo yoosetmessages: + msg283667
2016-12-20 04:38:29brendandsetnosy: + brendand
messages: + msg283666
2016-12-20 03:48:15woo yoosetmessages: + msg283663
2016-12-19 14:00:50woo yoosetmessages: + msg283623
2016-12-19 13:20:45r.david.murraysetnosy: + r.david.murray
messages: + msg283622
2016-12-19 13:15:33woo yoosetmessages: + msg283621
2016-12-19 08:38:27brendan-donegansetnosy: + brendan-donegan
messages: + msg283596
2016-12-19 04:46:18woo yoosetversions: + Python 3.5, Python 3.6
nosy: + docs@python

messages: + msg283581

assignee: docs@python
components: + Documentation
2016-12-19 04:45:33woo yoocreate