[Python-ideas] Repurpose `assert' into a general-purpose check
Serhiy Storchaka
storchaka at gmail.com
Tue Nov 28 15:42:20 EST 2017
More information about the Python-ideas mailing list
Tue Nov 28 15:42:20 EST 2017
- Previous message (by thread): [Python-ideas] Repurpose `assert' into a general-purpose check
- Next message (by thread): [Python-ideas] Repurpose `assert' into a general-purpose check
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
28.11.17 15:36, Nick Coghlan пише:
> * I'm opposed to making assert substantially different from the way it works now
If sometimes we will change assert I would prefer to make it more
similar to assert in pytest. Output values of the final and intermediate
expressions. The hardest problem -- the repr can be very long and
expensive, we need an alternate protocol for producing a shortened
representation.
> * I'm in favour of adding a new "ensure()" builtin that encapsulates
> the check-and-raise logic
Then may be add a new "die()" buildin? ;-)
0 <= r < abs(y) or die()
- Previous message (by thread): [Python-ideas] Repurpose `assert' into a general-purpose check
- Next message (by thread): [Python-ideas] Repurpose `assert' into a general-purpose check
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-ideas mailing list