Skip to content
This repository has been archived by the owner on Jul 5, 2023. It is now read-only.

What's the point of inserting a space character in the dump before extra fields? #23

Closed
mbdevpl opened this issue Dec 27, 2016 · 1 comment

Comments

@mbdevpl
Copy link

mbdevpl commented Dec 27, 2016

In dump() function, there's the following expression in line 116:

rv += fields and ', ' or ' '

The space character literal at the end of the expression causes the dump of e.g. Pass to be:

Pass( lineno=44, col_offset=4)

Is there a point to this? Or, could it be that this space should be removed, so that the dump is:

Pass(lineno=44, col_offset=4)

?

I've done this in this commit, should I PR? mbdevpl@589d064

@ddfisher
Copy link
Collaborator

ddfisher commented Jan 5, 2017

That's a good question, but you'll have to ask the CPython folks. The dump() function in ast27 and ast35 is exactly the same as the version in the CPython ast library. (See here.) typed_ast is intended to behave as similarly as possible to ast (aside from type comment-related changes), so I don't want to change this behavior, even though I agree it's a little strange.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants