This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: ast.Call signature changed
Type: behavior Stage:
Components: Documentation Versions: Python 3.5
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, ezio.melotti, mbussonn, willingc
Priority: normal Keywords:

Created on 2015-05-17 20:10 by mbussonn, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (6)
msg243427 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2015-05-17 20:10
The `ast.Call/_ast.Call` signature, changed on May 5th (https://hg.python.org/cpython/rev/95886) which causes some error in package using ast (https://bitbucket.org/pytest-dev/pytest/issue/744/pytest-assert-rewriting-broken-with-python#). There does not seem to be any docs in the what's new about the change, though http://bugs.python.org/issue24136 is suppose to track some docs change, so not complaining about that.

Could `ast` shims the old signature and raise a warning until 3.6, to give some time for package to adapt ?
msg243454 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2015-05-18 04:44
Matthias, Did you wish to mark this issue for additional Documentation and as a behavior change request (warning of signature change until 3.6) in addition to Devguide?

I've summarized below some info from researching Matthias' original message. I see three questions to answer:
a) Should `ast` shim the old signature and raise a warning until 3.6?
b) What additional items should be added to Documentation or Porting Guide?
c) What items should be added to Devguide?

**Background**
Implementation of PEP 448 (Additional Unpacking Generalizations) changed the ast.Call/_ast.Call signature by removing two arguments (args, kwargs).

Testing errors are seen in existing code that does not take into account the signature change.['1'][1]

**Workaround**
Matthias' possible workaround for existing projects to check for version 3.5 or higher and adapt to two less arguments.['2'][2]

**Devguide addition**
Thomas Kluyver's supplementary information about AST use.['3'][3] Perhaps mention this in the AST section of the devguide. I recognize that typically the devguide does not reference external docs but this seems like it would be useful to future developers.


    [1]: https://bitbucket.org/pytest-dev/pytest/issue/744/pytest-assert-rewriting-broken-with-python#
    [2]: https://bitbucket.org/pytest-dev/pytest/pull-request/296/astcall-signature-changed-on-35/diff
    [3]: https://greentreesnakes.readthedocs.org/en/latest/
msg243456 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2015-05-18 05:15
Hi Carol, 

> Matthias, Did you wish to mark this issue for additional Documentation and as a behavior change request (warning of signature change until 3.6) in addition to Devguide?

Hum, probably, I'm not super familiar with this bug tracker and it use, I've tried to select both Devguide and Docs now.

> a) Should `ast` shim the old signature and raise a warning until 3.6?

From Guido's comment on linked issue, I guess not: 

> "There is no compatibility guarantee for the ast module"


> b) What additional items should be added to Documentation or Porting Guide?

I guess that Call api changed in the what's new. A link to a rough implementation that show how to get code compatible on 3.5 and below would be nice, it is kind of painful to iterate through the new AST structure and figure things out.

> c) What items should be added to Devguide?

I can talk to Thomas Kluyver tomorrow about merging green tree snake into the devguide, or maybe into ast docs. Would that be useful/more acceptable than linking to external docs ?

Thanks.
msg243471 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-05-18 12:18
Thanks for the report, Matthias.

> I can talk to Thomas Kluyver tomorrow about merging green tree snake into the devguide,

devguide isn't the correct place for such documentation.

> or maybe into ast docs. Would that be useful/more acceptable than linking to external docs ?

There is an open issue for that: issue 16544. I've talked to Thomas about merging greentreesnakes to the AST documentation last year and already have a WIP patch at https://gist.github.com/berkerpeksag/0be9bb0ada548185d9ef (I have more complete patch, but couldn't find it now :))

If you have time to work on it, I can upload it to the tracker item and we can work together.
msg243478 - (view) Author: Matthias Bussonnier (mbussonn) * Date: 2015-05-18 13:22
> There is an open issue for that: issue 16544. I've talked to Thomas about merging greentreesnakes to the AST documentation last year and already have a WIP patch

Ah, Thanks for the link, I see if I can rotate my chair 120deg clockwise and give a nudge to Thomas.

I'll probably have a hard time working on that this week, but can try to push it forward to be up to date with 3.5.
msg243484 - (view) Author: Carol Willing (willingc) * (Python committer) Date: 2015-05-18 14:54
Thanks Berker for pointing out the WIP patch for issue 16544. Issue 16544 seems a better place than this issue for addressing the ast documentation.

There does not seem to be any additional action items left on this issue so I recommend closing this issue and moving discussion for ast documentation to Issue 16544.
History
Date User Action Args
2022-04-11 14:58:17adminsetgithub: 68408
2015-05-18 14:54:22willingcsetstatus: open -> closed
resolution: duplicate
messages: + msg243484
2015-05-18 13:22:34mbussonnsetmessages: + msg243478
2015-05-18 12:18:38berker.peksagsetnosy: + berker.peksag
messages: + msg243471
components: - Devguide
2015-05-18 05:15:51mbussonnsetnosy: + docs@python
messages: + msg243456

assignee: docs@python
components: + Documentation
2015-05-18 04:44:30willingcsetmessages: + msg243454
2015-05-17 20:10:38mbussonncreate