[issue39999] Fix some issues with AST node classes

2020-03-22 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-22 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset bace59d8b8e38f5c779ff6296ebdc0527f6db14a by Serhiy Storchaka in 
branch 'master':
bpo-3: Improve compatibility of the ast module. (GH-19056)
https://github.com/python/cpython/commit/bace59d8b8e38f5c779ff6296ebdc0527f6db14a


--

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-18 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

I see, thanks for the explanation.

--

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-18 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Yes, and this what PR 19056 does. It is not difficult, and if we can avoid a 
breakage, why not do this? We have kept all other deprecated classes, like Num 
and ExtSlice. In 3.10 we can add runtime warnings, and remove them in some 
future releases.

We alreade got a benefit of simplifying the compiler. Maintaining dummy classes 
does not cost much.

--

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-18 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +18408
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/19056

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-18 Thread Batuhan Taskaya


Batuhan Taskaya  added the comment:

> 1. Re-add removed classes Suite, Param, AugLoad and AugStore. They are not 
> used in Python 3, are not created by the parser and are not accepted by the 
> compiler. Param was used in 2.7, other classes were not used longer time. But 
> some third-party projects (e.g. pyflakes) use them for isinstance checks.

I dont think Suite used in anywhere related to CPython, and for others (Param 
and Aug contexts, which both used in pyflakes) I dont think it is necessary 
to have them. For most of the part they can just do this

if not PY27:
 class Param(ast.expr_context): pass

and looks like pyflakes already have a PR about this (not this way, but it is 
common to have version-specific conditions in AST tools).

--
nosy: +BTaskaya

___
Python tracker 

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



[issue39999] Fix some issues with AST node classes

2020-03-18 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR fixes some issues related to recent changes in the AST node 
classes.

1. Re-add removed classes Suite, Param, AugLoad and AugStore. They are not used 
in Python 3, are not created by the parser and are not accepted by the 
compiler. Param was used in 2.7, other classes were not used longer time. But 
some third-party projects (e.g. pyflakes) use them for isinstance checks.

2. Add docstrings for all dummy AST classes (Constant subclasses, Index, 
ExtTuple and the above four classes). Otherwise they inherited docstrings from 
the parent class.

3. Add docstrings for all attribute aliases.

4. Set __module__ = "ast" instead of "_ast" for all classes defined in the _ast 
module. Otherwise the help for the ast module would show only dummy classes, 
not actual AST node classes. It also makes pickles more compatible between 
versions.

--
components: Library (Lib)
messages: 364504
nosy: serhiy.storchaka
priority: normal
severity: normal
status: open
title: Fix some issues with AST node classes
type: enhancement
versions: Python 3.9

___
Python tracker 

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