Issue 29010: Incorrect description about scope related with inheritance
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) * ![]() |
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) * ![]() |
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:40 | admin | set | github: 73196 |
| 2021-11-19 17:34:43 | iritkatriel | set | keywords:
+ easy, newcomer friendly versions: + Python 3.9, Python 3.10, Python 3.11, - Python 3.5, Python 3.6 |
| 2016-12-20 14:57:49 | woo yoo | set | messages: + msg283696 |
| 2016-12-20 14:49:45 | brendan-donegan | set | messages: + msg283694 |
| 2016-12-20 14:35:15 | r.david.murray | set | messages: + msg283691 |
| 2016-12-20 05:18:29 | woo yoo | set | messages: + msg283667 |
| 2016-12-20 04:38:29 | brendand | set | nosy:
+ brendand messages: + msg283666 |
| 2016-12-20 03:48:15 | woo yoo | set | messages: + msg283663 |
| 2016-12-19 14:00:50 | woo yoo | set | messages: + msg283623 |
| 2016-12-19 13:20:45 | r.david.murray | set | nosy:
+ r.david.murray messages: + msg283622 |
| 2016-12-19 13:15:33 | woo yoo | set | messages: + msg283621 |
| 2016-12-19 08:38:27 | brendan-donegan | set | nosy:
+ brendan-donegan messages: + msg283596 |
| 2016-12-19 04:46:18 | woo yoo | set | versions:
+ Python 3.5, Python 3.6 nosy: + docs@python messages: + msg283581 assignee: docs@python |
| 2016-12-19 04:45:33 | woo yoo | create | |
