On Mon, May 15, 2017 at 11:17:48PM +1000, Chris Angelico wrote:
> On Mon, May 15, 2017 at 11:00 PM, Steven D'Aprano wrote:
> > There's also cases where
> >
> > if x > y:
> > pass
> > else:
> > code
> >
> > is *not necessarily* the same as
> >
> > if not (x > y):
> >
On 15.05.17 18:46, Ryan Gonzalez wrote:
I guess maybe if you overload the operators to return broken objects,
maybe then they would be different?
No. The compiler generates an equivalent bytecode for both cases.
___
Python-ideas mailing list
Python-i
Something broken like this?
import inspect
def cond():
if 'not cond' in inspect.stack()[1].code_context[0]:
return False
return True
if cond():
print('yes')
else:
print('no')
if not cond():
print('no')
else:
print('yes')
On 5/15/17, Ryan Gonzalez wrote:
> I gues
I guess maybe if you overload the operators to return broken objects, maybe
then they would be different?
--
Ryan (ライアン)
Yoko Shimomura > ryo (supercell/EGOIST) > Hiroyuki Sawano >> everyone else
http://refi64.com
On May 15, 2017 9:50 AM, "Serhiy Storchaka" wrote:
> On 15.05.17 16:00, Steven D'
On 15.05.17 16:00, Steven D'Aprano wrote:
There's also cases where
if x > y:
pass
else:
code
is *not necessarily* the same as
if not (x > y):
code
This is not true.
if not cond:
stmt1
else:
stmt2
always is equivalent to
if co
On Mon, May 15, 2017 at 11:00 PM, Steven D'Aprano wrote:
> On Mon, May 15, 2017 at 08:13:48PM +1000, Chris Angelico wrote:
>> On Mon, May 15, 2017 at 7:38 PM, Hugh Fisher wrote:
>> > I wrote this little Python program using CPython 3.5.2. It's ...
>> > interesting ... that we apparently don't nee
On Mon, May 15, 2017 at 08:13:48PM +1000, Chris Angelico wrote:
> On Mon, May 15, 2017 at 7:38 PM, Hugh Fisher wrote:
> > I wrote this little Python program using CPython 3.5.2. It's ...
> > interesting ... that we apparently don't need comments or pass
> > statements any more. Anyone else think i
On Mon, May 15, 2017 at 07:38:29PM +1000, Hugh Fisher wrote:
> I wrote this little Python program using CPython 3.5.2. It's ...
> interesting ... that we apparently don't need comments or pass
> statements any more.
I'm not sure what you mean by "any more". The code you give works,
unchanged, a
On Mon, May 15, 2017 at 7:38 PM, Hugh Fisher wrote:
> I wrote this little Python program using CPython 3.5.2. It's ...
> interesting ... that we apparently don't need comments or pass
> statements any more. Anyone else think it might be worth tightening up
> the grammar definition and parser a bit
I wrote this little Python program using CPython 3.5.2. It's ...
interesting ... that we apparently don't need comments or pass
statements any more. Anyone else think it might be worth tightening up
the grammar definition and parser a bit?
def empty():
"""Don't do anything"""
def helloWorld()
10 matches
Mail list logo