Skip to content

spurious error with __slots__ and unicode_literals #421

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

Closed
pylint-bot opened this issue Jan 2, 2015 · 1 comment
Closed

spurious error with __slots__ and unicode_literals #421

pylint-bot opened this issue Jan 2, 2015 · 1 comment
Labels
Bug 🪲 Checkers Related to a checker

Comments

@pylint-bot
Copy link

Originally reported by: BitBucket: andreasvc, GitHub: @andreasvc?


When unicode_literals is enabled, an error is reported that only strings are acceptable in __slots__:

Invalid object "u'foo'" in __slots__, must contain only non empty strings (invalid-slots-object)

However, unicode strings in slots are acceptable in Python 2, and using unicode helps in writing code that is compatible in both Python 2 and 3.


@pylint-bot
Copy link
Author

Original comment by Claudiu Popa (BitBucket: PCManticore, GitHub: @PCManticore):


Fix a false positive with invalid-slots-objects and unicode strings. Closes issue #421.

@pylint-bot pylint-bot added Bug 🪲 Checkers Related to a checker labels Dec 9, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug 🪲 Checkers Related to a checker
Projects
None yet
Development

No branches or pull requests

1 participant