Your original proposal appears to want this behavior:
class BaseException:
def __call__(self):
raise self
That could be expanded to something like:
class BaseException:
def __call__(self, *args):
if not args:
raise self
if len(args) > 1:
Ty
On 2020-07-05 12:58 p.m., MRAB wrote:
On 2020-07-05 14:10, Soni L. wrote:
On 2020-07-05 10:03 a.m., MRAB wrote:
On 2020-07-05 13:39, Soni L. wrote:
1. saves keywords and 2. can be passed as callables.
since there's no lambda: raise, 2 is a new feature.
How would you re-raise an exceptio
On 2020-07-05 14:10, Soni L. wrote:
On 2020-07-05 10:03 a.m., MRAB wrote:
On 2020-07-05 13:39, Soni L. wrote:
1. saves keywords and 2. can be passed as callables.
since there's no lambda: raise, 2 is a new feature.
How would you re-raise an exception?
just call it.
Wouldn't that just c
On Sun, Jul 05, 2020 at 10:10:01AM -0300, Soni L. wrote:
> >What would be the replacement for:
> >
> > raise ex from None
> >
> >and so forth?
>
> no idea. just don't use that anymore?
So your plan is to make Python less useful, less powerful, and be unable
to do things that it can do now? S
On 2020-07-05 10:03 a.m., MRAB wrote:
On 2020-07-05 13:39, Soni L. wrote:
1. saves keywords and 2. can be passed as callables.
since there's no lambda: raise, 2 is a new feature.
How would you re-raise an exception?
just call it.
What would be the replacement for:
raise ex from No
On 2020-07-05 13:39, Soni L. wrote:
1. saves keywords and 2. can be passed as callables.
since there's no lambda: raise, 2 is a new feature.
How would you re-raise an exception?
What would be the replacement for:
raise ex from None
and so forth?
I prefer the clarity of knowing that it'
1. saves keywords and 2. can be passed as callables.
since there's no lambda: raise, 2 is a new feature.
On 2020-07-05 1:15 a.m., Steven D'Aprano wrote:
On Sun, Jul 05, 2020 at 12:48:08AM -0300, Soni L. wrote:
> ValueError()() should be the same as raise ValueError() but with an
> extra call l
On Sun, Jul 05, 2020 at 12:48:08AM -0300, Soni L. wrote:
> ValueError()() should be the same as raise ValueError() but with an
> extra call level.
>
> and raise should be deprecated.
Proposals that are given without justification should be rejected
without justification:
"No they shouldn't."