On Wed, Dec 3, 2014 at 10:59 PM, Tim Chase
wrote:
> On 2014-12-02 23:05, Dennis Lee Bieber wrote:
>> > foo == 42 or else
>>
>> Has a PERL stink to it... like: foo == 42 or die
>
> This statement actually works in Python and I occasionally use it
> when debugging (in the same fashion as one
On 2014-12-02 23:05, Dennis Lee Bieber wrote:
> > foo == 42 or else
>
> Has a PERL stink to it... like: foo == 42 or die
This statement actually works in Python and I occasionally use it
when debugging (in the same fashion as one might do printf()
debugging in C). It raises a NameError a
On Wed, Dec 3, 2014 at 10:56 PM, Tim Chase
wrote:
> This actually works in Python and I occasionally use in debugging
> (much like
finish_sentence() or die
ChrisA
--
https://mail.python.org/mailman/listinfo/python-list
On 2014-12-02 23:05, Dennis Lee Bieber wrote:
> > foo == 42 or else
>
> Has a PERL stink to it... like: foo == 42 or die
This actually works in Python and I occasionally use in debugging
(much like
--
https://mail.python.org/mailman/listinfo/python-list
Dennis Lee Bieber wrote:
>> foo == 42 or else
>>
>
> Has a PERL stink to it... like: foo == 42 or die
I think this statement needs to take ellipsis as well
foo == 42 or else ...
Sturls
--
https://mail.python.org/mailman/listinfo/python-list
On 12/02/2014 10:18 AM, Roy Smith wrote:
> In the process of refactoring some code, I serendipitously created what I
> think is an essential new bit of Python syntax. The “or else” statement. I
> ended up with:
>
> sites_string = args.sites or else self.config['sites']
But isn't that
In article ,
Chris Angelico wrote:
> On Wed, Dec 3, 2014 at 4:41 AM, Zachary Ware
> wrote:
> > On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
> >> Wouldnât it be neat to write:
> >>
> >>foo == 42 or else
> >>
> >> and have that be an synonym for:
> >>
> >> assert foo == 42
> >>
>
Zachary Ware wrote:
> On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
>> Wouldn’t it be neat to write:
>>
>>foo == 42 or else
>>
>> and have that be an synonym for:
>>
>> assert foo == 42
>>
>> :-)
>
> Never going to happen, but I like it! Perhaps raise IntimidationError
> instead
On 2014-12-02 17:41:06 +, Zachary Ware said:
foo == 42 or else
Never going to happen, but I like it! Perhaps raise IntimidationError
instead of AssertionError when it fails?
That should probably be a DONTPANICError in large, friendly terminal
font letters.
--
Andrea
--
https://mail
Tim Chase :
>> >foo == 42 or else
>
> In light of the parallel thread discussing the "assert" statement and
> the perils of trusting it to be present even though it can be
> optimized away, this "or else" could be (in the altered words of Don
> Corleone), "I'm gonna make an assertion he can't
On 2014-12-02 11:41, Zachary Ware wrote:
> On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
> > Wouldn’t it be neat to write:
> >
> >foo == 42 or else
> >
> > and have that be an synonym for:
> >
> > assert foo == 42
> >
> > :-)
>
> Never going to happen, but I like it! Perhaps raise
>
On Wed, Dec 3, 2014 at 4:41 AM, Zachary Ware
wrote:
> On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
>> Wouldn’t it be neat to write:
>>
>>foo == 42 or else
>>
>> and have that be an synonym for:
>>
>> assert foo == 42
>>
>> :-)
>
> Never going to happen, but I like it! Perhaps raise
On 12/02/2014 09:41 AM, Zachary Ware wrote:
> On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
>>
>> Wouldn’t it be neat to write:
>>
>>foo == 42 or else
>>
>> and have that be an synonym for:
>>
>> assert foo == 42
>
> Never going to happen, but I like it! Perhaps raise IntimidationErro
On Tue, Dec 2, 2014 at 11:18 AM, Roy Smith wrote:
> Wouldn’t it be neat to write:
>
>foo == 42 or else
>
> and have that be an synonym for:
>
> assert foo == 42
>
> :-)
Never going to happen, but I like it! Perhaps raise IntimidationError
instead of AssertionError when it fails?
--
Zac
In the process of refactoring some code, I serendipitously created what I think
is an essential new bit of Python syntax. The “or else” statement. I ended up
with:
sites_string = args.sites or else self.config['sites']
which, of course, is a syntax error today, but it got me thinking
15 matches
Mail list logo