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

Warn of mistaken trailing commas creating tuples #300

Closed
pylint-bot opened this issue Aug 8, 2014 · 0 comments
Closed

Warn of mistaken trailing commas creating tuples #300

pylint-bot opened this issue Aug 8, 2014 · 0 comments
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component

Comments

@pylint-bot
Copy link

Originally reported by: Anonymous


As seen on the previous issue tracker here: http://www.logilab.org/92253.

The issue has bitten me a few times now. As mentioned in the old issue/ticket, something like:

#!python

>>> x = 1,    # Syntactically valid, but probably not what most programmers mean
>>> x
(1,)

I believe this is a worthy thing to warn about because there is already more explicit syntax in Python for tuple initialization with parentheses.


@pylint-bot pylint-bot added Enhancement ✨ Improvement to a component Checkers Related to a checker labels Dec 9, 2015
msuozzo pushed a commit to msuozzo/pylint that referenced this issue Feb 18, 2022
PEP 484 specifies that they be hinted as the type of a single element,
as seen from the caller's perspective.

Closes pylint-dev#289.

Co-authored-by: Christopher Wilcox <crwilcox@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Checkers Related to a checker Enhancement ✨ Improvement to a component
Projects
None yet
Development

No branches or pull requests

1 participant