Skip to content
New issue

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

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

Already on GitHub? # to your account

__version__ is not a violation of the Twisted naming convention #77

Merged
merged 4 commits into from
Jun 12, 2015

Conversation

adiroiban
Copy link
Member

This twistedchecker warning is invalid:

C0103:114,8:DummyOpenSSL.__init__: Invalid name "__version__" (should match ((([a-z_])|([a-z]+_[a-z]))[a-zA-Z0-9]+)$)

@adiroiban
Copy link
Member

@exarkun version is an exception from the rule or there is a problem with the regex for names?

Thanks!

@exarkun
Copy link
Member Author

exarkun commented Sep 30, 2014

__version__ is an example of a convention for naming certain things that's not disallowed by the coding standard.

It's a standard Python idiom to have package.__version__. Twisted should do this. It shouldn't be a twistedchecker error to define such a name.

Apart from that, DummyOpenSSL is a fake for a third-party library. Twisted can't do anything about the naming convention of third-party libraries. If the code were self.some_variable = value, this actually wouldn't conform to Twisted's naming convention but it would still be how the code must be written - if the third-party library dictates this.

@adiroiban
Copy link
Member

thanks... I assume that all these "errors" came from pylint .... I stopped using pylint a long time ago as it was too pedantic... maybe we should remove pylint from pychecker and only build extra things around pyflakes..

@adiroiban
Copy link
Member

Please take a look at latest changes.

I have merged to pass/fail tests for attribute names into a single test as I find it easier to follow good/bad examples.

Thanks!

@glyph
Copy link
Member

glyph commented Mar 24, 2015

Looks like this needs a merge, but is otherwise fine.

@adiroiban
Copy link
Member

Thanks for the review. Please check latest changes.

needs-review

adiroiban added a commit that referenced this pull request Jun 12, 2015
`__version__` is not a violation of the Twisted naming convention.
@adiroiban adiroiban merged commit baef9ed into master Jun 12, 2015
@tomprince tomprince deleted the 77-special-var-names branch December 21, 2016 06:56
@adiroiban adiroiban restored the 77-special-var-names branch October 19, 2017 09:22
@adiroiban adiroiban deleted the 77-special-var-names branch October 19, 2017 09:23
# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants