Skip to content
This repository was archived by the owner on Jul 5, 2023. It is now read-only.
This repository was 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

Description

@mbdevpl

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

Activity

  1. ddfisher commented on Jan 5, 2017

    @ddfisher
    Collaborator

    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 join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions