Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trailing commas #41

Open
anntzer opened this issue Mar 11, 2019 · 1 comment
Open

trailing commas #41

anntzer opened this issue Mar 11, 2019 · 1 comment

Comments

@anntzer
Copy link
Contributor

anntzer commented Mar 11, 2019

  • PrettyPrinter version: 0.16.0
  • Python version: 3.7
  • Operating System: linux

Description

Currently, prettyprinter formats collections without a comma after the last element. Adding a comma there is optional, but suggested in some style guides, including PEP8 (https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas). It would be nice if prettyprinter also added the comma (or provided a configurable option to do so).

What I Did

In [1]: sys.version_info                                                                                                                                                                            
Out[1]: 
sys.version_info((
    3,  # major
    7,  # minor
    2,  # micro
    'final',  # releaselevel
    0  # serial
))

expected a comma in 0, # serial.

@tommikaikkonen
Copy link
Owner

I agree, I think we can add this as a configurable option. I'll see if I can make this change sometime this week to ship in a new release with the PRs I merged in today.

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

No branches or pull requests

2 participants