Re: [Python-ideas] Arguments to exceptions

2017-07-07 Thread Nick Coghlan
On 7 July 2017 at 22:23, Koos Zevenhoven wrote: > On Fri, Jul 7, 2017 at 7:28 AM, Nick Coghlan wrote: >> >> >> As a result, our advice is to *avoid* trying to come up with systemic >> fixes for structured exception handling, and instead focus on specific >> use cases of "I want *this* exception t

[Python-ideas] Consider allowing the use of abstractmethod without metaclasses

2017-07-07 Thread Neil Girdhar
I want to use abstractmethod, but I have my own metaclasses and I don't want to build composite metaclasses using abc.ABCMeta. Thanks to PEP 487, one approach is to facator out the abstractmethod checks from ABCMeta into a regular (non-meta) class. So, my first suggestion is to split abc.ABC i

Re: [Python-ideas] Improving Catching Exceptions

2017-07-07 Thread Jan Kaliszewski
2017-06-25 Greg Ewing dixit: > > (2) There's a *specific* problem with property where a bug in your > > getter or setter that raises AttributeError will be masked, > > appearing as if the property itself doesn't exist. [...] > Case 2 needs to be addressed within the method concerned on a > case-

Re: [Python-ideas] Arguments to exceptions

2017-07-07 Thread Koos Zevenhoven
On Fri, Jul 7, 2017 at 7:28 AM, Nick Coghlan wrote: > > As a result, our advice is to *avoid* trying to come up with systemic > fixes for structured exception handling, and instead focus on specific > use cases of "I want *this* exception type to have *that* attribute > for *these* reasons". Thos

Re: [Python-ideas] Arguments to exceptions

2017-07-07 Thread Paul Moore
On 7 July 2017 at 04:54, Jeff Walker wrote: > Here is an example: > > class NameError(BaseException): > pass > > try: > raise NameError('welker', db='users', template='{0}: unknown {db}.') > except NameError as e: > unknown_name = e.args[0] > missing_fr