From sahumada at texla.cl Sat Sep 17 13:47:24 2016 From: sahumada at texla.cl (Sergio Ahumada) Date: Sat, 17 Sep 2016 19:47:24 +0200 Subject: [code-quality] pylint: no-member PROTOCOL_SSLv23 for ssl Message-ID: <00032817-1d21-0727-20ce-65856bd2b55f@texla.cl> Hello, First of all, excuse me if this is not the right place to ask this simple question. I have this very simple example that when run through pylint gives me the following error: sahumada at sahumada-ThinkPad-T510:~$ cat d.py import ssl print ssl.PROTOCOL_SSLv23 sahumada at sahumada-ThinkPad-T510:~$ python d.py 2 sahumada at sahumada-ThinkPad-T510:~$ pylint -r n d.py ************* Module d E: 3, 6: Module 'ssl' has no 'PROTOCOL_SSLv23' member (no-member) sahumada at sahumada-ThinkPad-T510:~$ python --version Python 2.7.12 sahumada at sahumada-ThinkPad-T510:~$ pylint --version pylint 1.5.2, astroid 1.4.4 Python 2.7.12 (default, Jul 1 2016, 15:12:24) [GCC 5.4.0 20160609] sahumada at sahumada-ThinkPad-T510:~$ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial Any ideas? Cheers, -- Sergio Ahumada sahumada at texla.cl From me at the-compiler.org Sun Sep 18 08:22:48 2016 From: me at the-compiler.org (Florian Bruhin) Date: Sun, 18 Sep 2016 14:22:48 +0200 Subject: [code-quality] pylint: no-member PROTOCOL_SSLv23 for ssl In-Reply-To: <00032817-1d21-0727-20ce-65856bd2b55f@texla.cl> References: <00032817-1d21-0727-20ce-65856bd2b55f@texla.cl> Message-ID: <20160918122248.ngrforyzkqqjz6h3@tonks> * Sergio Ahumada [2016-09-17 19:47:24 +0200]: > sahumada at sahumada-ThinkPad-T510:~$ pylint -r n d.py > ************* Module d > E: 3, 6: Module 'ssl' has no 'PROTOCOL_SSLv23' member (no-member) See https://github.com/PyCQA/pylint/issues/399 > sahumada at sahumada-ThinkPad-T510:~$ pylint --version > pylint 1.5.2, > astroid 1.4.4 You might want to update to pylint 1.6.4 and astroid 1.4.8 where this is fixed. Florian -- http://www.the-compiler.org | me at the-compiler.org (Mail/XMPP) GPG: 916E B0C8 FD55 A072 | http://the-compiler.org/pubkey.asc I love long mails! | http://email.is-not-s.ms/ -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 801 bytes Desc: not available URL: From stephenfinucane at hotmail.com Thu Sep 22 10:22:47 2016 From: stephenfinucane at hotmail.com (Stephen Finucane) Date: Thu, 22 Sep 2016 15:22:47 +0100 Subject: [code-quality] Adding a new repo to 'PyCQA' org Message-ID: Hey, I recently published a flake8 plugin on GitHub: https://github.com/stephenfin/flake8-asserts In my experience, finding flake8 plugins is easier said than done and the best are found on the 'PyCQA' org on GitHub/GitLab. Would this project be something that the organization would be interested in moving under their umbrella? I'm thinking of making use of it in some OpenStack projects, but who knows... Stephen -------------- next part -------------- An HTML attachment was scrubbed... URL: From graffatcolmingov at gmail.com Thu Sep 22 11:14:47 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Thu, 22 Sep 2016 10:14:47 -0500 Subject: [code-quality] Adding a new repo to 'PyCQA' org In-Reply-To: References: Message-ID: On Thu, Sep 22, 2016 at 9:22 AM, Stephen Finucane wrote: > Hey, > > I recently published a flake8 plugin on GitHub: > > https://github.com/stephenfin/flake8-asserts > > In my experience, finding flake8 plugins is easier said than done and the > best are found on the 'PyCQA' org on GitHub/GitLab. Would this project be > something that the organization would be interested in moving under their > umbrella? I'm thinking of making use of it in some OpenStack projects, but > who knows... Hi Stephen! So, we generally try to take on projects that are already widely used and benefit from the a larger group's attention. If you'd really like the project to live in the PyCQA, we can accomodate that. The rest of us are already overloaded with commitments so we'd need a commitment from you that you are going to maintain this. We can create a team for you and make you team maintainer so you can add more people to the team as more contributors come along. If your project is more geared towards OpenStack, you might instead want to include it in the OpenStack project namespace as a non-Big-Tent project. Hacking lives there and OpenStack is happy having it there. (Hint: I also work on hacking, although not as much as I've wanted to as of late.) They also hate "third-party" dependencies and will probably be happier (if it's geared towards them) if you would maintain it there. Also, it looks as if you didn't closely follow the Flake8 documentation around building a Flake8 extension (http://flake8.pycqa.org/en/latest/plugin-development/registering-plugins.html) which points out that you should add the "Framework :: Flake8" classifier for extensions to make it easier to find things. I haven't had time to update the discoverable Flake8 projects to use this universally but number of the more popular ones are using it. Cheers, Ian From bje at air.net.au Wed Sep 28 06:40:13 2016 From: bje at air.net.au (Ben Elliston) Date: Wed, 28 Sep 2016 20:40:13 +1000 Subject: [code-quality] false positive for unidiomatic-typecheck? Message-ID: <20160928104013.GA30791@air.net.au> I am seeing the following message from pylint: foo.py:311: [C0123(unidiomatic-typecheck), _legend] Using type() instead of isinstance() for a typecheck. My line is: if type(g) not in unique: That is, I am maintaing a list of unique types in a set of objects. This isn't a typecheck. Shouldn't the warning only be produced when type(x) is compared with type(y)? Thanks, Ben From vgr255 at live.ca Wed Sep 28 07:20:48 2016 From: vgr255 at live.ca (Emanuel Barry) Date: Wed, 28 Sep 2016 11:20:48 +0000 Subject: [code-quality] false positive for unidiomatic-typecheck? In-Reply-To: <20160928104013.GA30791@air.net.au> References: <20160928104013.GA30791@air.net.au> Message-ID: > From: Of Ben Elliston > Sent: Wednesday, September 28, 2016 6:40 AM > To: code-quality at python.org > Subject: [code-quality] false positive for unidiomatic-typecheck? > > I am seeing the following message from pylint: > > foo.py:311: [C0123(unidiomatic-typecheck), _legend] Using type() instead of > isinstance() for a typecheck. > > My line is: > if type(g) not in unique: Do note that this is the same as if isinstance(g, tuple(unique)): Since isinstance() accepts either a type or a tuple or types (not a set, list, or any other iterable, though). > > That is, I am maintaing a list of unique types in a set of objects. > This isn't a typecheck. Shouldn't the warning only be produced when > type(x) is compared with type(y)? > Actually, that is a typecheck; it's just not one you're used to seeing. You're checking for the presence of the type of 'g' in a set. Using `type(x)` is often unidiomatic, and in almost every case (including this one), you have a better alternative :) > Thanks, Ben -Emanuel From ned at nedbatchelder.com Wed Sep 28 08:25:30 2016 From: ned at nedbatchelder.com (Ned Batchelder) Date: Wed, 28 Sep 2016 08:25:30 -0400 Subject: [code-quality] false positive for unidiomatic-typecheck? In-Reply-To: <20160928104013.GA30791@air.net.au> References: <20160928104013.GA30791@air.net.au> Message-ID: On 9/28/16 6:40 AM, Ben Elliston wrote: > I am seeing the following message from pylint: > > foo.py:311: [C0123(unidiomatic-typecheck), _legend] Using type() instead of isinstance() for a typecheck. > > My line is: > if type(g) not in unique: > > That is, I am maintaing a list of unique types in a set of objects. > This isn't a typecheck. Shouldn't the warning only be produced when > type(x) is compared with type(y)? I agree with pylint here: your line is unidiomatic. That doesn't mean it's a bad line. Just add a pylint pragma. It's OK to know more about your code than pylint does. --Ned.