[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Irit Katriel
Change by Irit Katriel : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington
miss-islington added the comment: New changeset 4affb996ce6353dd029ece0c7d36f7c7c0af2de3 by Miss Islington (bot) in branch '3.9': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/4affb996ce6353dd029ece0c7d36f7c7c0af2de3 --

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington
miss-islington added the comment: New changeset 0b3c3cbbaf2967cc17531d65ece0969b0d2a2079 by Miss Islington (bot) in branch '3.10': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/0b3c3cbbaf2967cc17531d65ece0969b0d2a2079 --

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +28585 pull_request: https://github.com/python/cpython/pull/30374 ___ Python tracker ___

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington
miss-islington added the comment: New changeset 2db56130631255ca2eb504519430fb2f1fe789e9 by Hugo van Kemenade in branch 'main': bpo-34538: Remove Exception subclassing from tutorial (GH-30361) https://github.com/python/cpython/commit/2db56130631255ca2eb504519430fb2f1fe789e9 --

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread miss-islington
Change by miss-islington : -- pull_requests: +28586 pull_request: https://github.com/python/cpython/pull/30375 ___ Python tracker ___

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Irit Katriel
Change by Irit Katriel : -- versions: +Python 3.11 -Python 3.8 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2022-01-03 Thread Hugo van Kemenade
Change by Hugo van Kemenade : -- keywords: +patch nosy: +hugovk nosy_count: 9.0 -> 10.0 pull_requests: +28575 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30361 ___ Python tracker

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2021-03-14 Thread Irit Katriel
Change by Irit Katriel : -- keywords: +easy versions: +Python 3.10, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Just as extra data point: It is fairly common to have a common exception class which is then used a mixin class together with the standard exception classes, so that you can indeed identify the source of an exception and catch errors based on the source

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Guido van Rossum
Guido van Rossum added the comment: I think as a general recommendation it is not such a good idea that we should specifically mention it. (Is it in PEP 8 too? If so it should be removed there too.) It's a pattern that is sometimes helpful, sometimes not. I don't think that people need to

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread Raymond Hettinger
Raymond Hettinger added the comment: Guido, the check-in message for this section indicates that Fred Drake added this wording at your behest. Do you still agree with the guidance and examples or would you like to have it removed from all active versions of the documentation as proposed?

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-10-01 Thread INADA Naoki
INADA Naoki added the comment: Thanks, Nathaniel. I totally concur with you. This is tutorial section. We should focus on readers of the tutorial. -- ___ Python tracker

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-09-11 Thread Nathaniel Manista
Nathaniel Manista added the comment: I’d like to try to steer this conversation back toward what I think is the actionable question: “does the exemplification of this practice in the Errors and Exceptions portion of The Python Tutorial bring about a net benefit or a net cost to its intended

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-31 Thread INADA Naoki
INADA Naoki added the comment: > https://github.com/search?q=%22except+TemplateError%22=Code For example, I found flask_mako's TemplateException in this search result. Strictly speaking, this is not base exception class. It is wraps exception during template rendering. But "why this class

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-31 Thread INADA Naoki
INADA Naoki added the comment: I didn't claim this pattern is not used anymore. My point is "should we suggest this pattern for tutorial readers?" * Is this pattern recommended blindly? -- I think no. * How / when this pattern is recommended? -- When there is use case people want to catch

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Ammar Askar
Ammar Askar added the comment: For some empirical data, I went through some popular packages that follow this pattern and searched for usage of their base exception classes: Requests: https://github.com/search?q=except+requests.RequestException=Code PyYaml:

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Brett Cannon
Brett Cannon added the comment: I'm not questioning if people have ever created a base exception for an entire package, I'm just asking how often it's actually used when the base exception didn't make sense outside of the rule-of-thumb Nathaniel is pointing out? For instance, it could makes

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: See https://bugs.python.org/issue443559 and "git log -p 13af42822cd". One other example from real code: requests.RequestException -- nosy: +fdrake ___ Python tracker

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-29 Thread Brett Cannon
Brett Cannon added the comment: I think the question is how often in real code to people want to catch all exceptions produced by a package or module but not any others. Perhaps it would be better to re-word the advice that when there are many related exceptions that it is suggested you

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-29 Thread INADA Naoki
INADA Naoki added the comment: > Also, it mirrors practices in the standard library (decimal.DecimalException > and sqlite3.DatabaseError). As Nathaniel said, "it's good idea in the particular circumstances of a particular module's implementation, but generally not." (I removed "very"

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: I think the advice should stay as-is. In my experience as a teacher, the possibility doesn't usually occur to people without it having been suggested. Also, it mirrors practices in the standard library (decimal.DecimalException and

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-29 Thread INADA Naoki
INADA Naoki added the comment: I agree with you. -- nosy: +inada.naoki ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue34538] Remove encouragement to author a base class for all Exception subclasses in a module

2018-08-28 Thread Nathaniel Manista
New submission from Nathaniel Manista : https://docs.python.org/3.8/tutorial/errors.html (and all other versions of that page back at least as far as 2.7) currently contain the guidance "When creating a module that can raise several distinct errors, a common practice is to create a base class