[issue34464] There are inconsitencies in the treatment of True, False, None, and __debug__ keywords in the docs

2019-03-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

@serhiy

The issue about the assigment operator is closed 
https://bugs.python.org/issue36052

could we close this issue?

thank you

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34464] There are inconsitencies in the treatment of True, False, None, and __debug__ keywords in the docs

2019-02-20 Thread R. David Murray


Change by R. David Murray :


--
versions:  -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34464] There are inconsitencies in the treatment of True, False, None, and __debug__ keywords in the docs

2019-02-20 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

__debug__ is not a keyword. And the error message has been changed in 3.8.

But it is a special enough. You can not use this name in any assignment context:

>>> __debug__ = 1
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> for __debug__ in []: pass
... 
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> with cm() as __debug__: pass
... 
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> class __debug__: pass
... 
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> def __debug__(): pass
... 
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> def foo(__debug__): pass
... 
  File "", line 1
SyntaxError: cannot assign to __debug__
>>> import __debug__
  File "", line 1
SyntaxError: cannot assign to __debug__

You can not even assign to an attribute named __debug__!

>>> x.__debug__ = 1
  File "", line 1
SyntaxError: cannot assign to __debug__

The assignment operator is the only exception here, and this looks like a bug.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34464] There are inconsitencies in the treatment of True, False, None, and __debug__ keywords in the docs

2019-02-20 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi @David,

Maybe we could remove 3.6 from the list because 3.6 is in security mode and not 
bugfix.

Is there a security issue with this bug?

--
nosy: +matrixise

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34464] There are inconsitencies in the treatment of True, False, None, and __debug__ keywords in the docs

2018-08-22 Thread R. David Murray


R. David Murray  added the comment:

I've removed 2.7 since those constants are not keywords in 2.7 (although None 
and __debug__ do raise syntax errors even in 2.7, they are not keywords there). 
 Which is almost certainly why the docs treat them inconsistently (leftovers 
from before they weren't keywords).  

We only update docs for the actively maintained versions, so I've removed 
everything before 3.6.  I also tried to clarify the issue in the title.

I don't know why you mention NotImplemented, that's not a keyword.

The issue with __debug__ and keywords.py probably requires a code change, since 
that file is auto-generated.  Please open a separate issue for that.

Thanks for wanting to improve python!

--
nosy: +r.david.murray
title: docs: keywords are special - eg constants.html -> There are 
inconsitencies in the treatment of True, False, None, and __debug__ keywords in 
the docs
versions:  -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com