From Eli.Tayrien at hbo.com Mon Jan 11 13:26:20 2016 From: Eli.Tayrien at hbo.com (Tayrien, Eli (HBO)) Date: Mon, 11 Jan 2016 18:26:20 +0000 Subject: [code-quality] pylint, enums, and redefined-variable-type Message-ID: Hello, I'm using python 3.4.2 and pylint 1.5.2. Pylint is printing a r:redefined-variable-type warning when I use a variable of type enum. The following script demonstrates the problem: from enum import Enum class MyEnum(Enum): Value1 = 1 Value2 = 2 myEnum = MyEnum.Value1 print("my enum is {}".format(myEnum)) # Huh? this line generates # warning R0204: Redefinition of myEnum type from EnumRepro.MyEnum.Value1 to # EnumRepro.MyEnum.Value2 [R:redefined-variable-type] myEnum = MyEnum.Value2 # this generates print("my enum is {}".format(myEnum)) Is this expected? At the moment I'm just disabling R0204 at the code locations that produce the problem ... I'm new to python, so perhaps I'm just doing something dim. Thanks! Eli This e-mail is intended only for the use of the addressees. Any copying, forwarding, printing or other use of this e-mail by persons other than the addressees is not authorized. This e-mail may contain information that is privileged, confidential and exempt from disclosure. If you are not the intended recipient, please notify us immediately by return e-mail (including the original message in your reply) and then delete and discard all copies of the e-mail. Thank you. -------------- next part -------------- An HTML attachment was scrubbed... URL: From me at the-compiler.org Tue Jan 12 02:00:12 2016 From: me at the-compiler.org (Florian Bruhin) Date: Tue, 12 Jan 2016 08:00:12 +0100 Subject: [code-quality] pylint, enums, and redefined-variable-type In-Reply-To: References: Message-ID: <20160112070011.GA6846@tonks> Hey Eli, * Tayrien, Eli (HBO) [2016-01-11 18:26:20 +0000]: > class MyEnum(Enum): > Value1 = 1 > Value2 = 2 As an aside: As many mail clients like to mess up the indentation when sending, it's best to use a pastebin or attach a script (if the mailinglist allows attachments) instead of posting it inline. > # Huh? this line generates > # warning R0204: Redefinition of myEnum type from EnumRepro.MyEnum.Value1 to > # EnumRepro.MyEnum.Value2 [R:redefined-variable-type] That smells like a pylint bug. I'm guessing astroid (the analysis library behind pylint) or pylint need to handle enums in some special way. FWIW, I also can reproduce it with astroid/pylint from the git repository. I suggest you open an issue at [1] and mention @lmedioni as she added that checker and is probably most familiar with it. Thanks! Florian [1] https://github.com/PyCQA/pylint/issues/new -- 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: 819 bytes Desc: Digital signature URL: From ben+python at benfinney.id.au Tue Jan 12 02:10:40 2016 From: ben+python at benfinney.id.au (Ben Finney) Date: Tue, 12 Jan 2016 18:10:40 +1100 Subject: [code-quality] Please post code inline, as plain text (was: pylint, enums, and redefined-variable-type) References: <20160112070011.GA6846@tonks> Message-ID: <85d1t7p91r.fsf_-_@benfinney.id.au> Florian Bruhin writes: > As an aside: As many mail clients like to mess up the indentation when > sending, it's best to use a pastebin or attach a script (if the > mailinglist allows attachments) instead of posting it inline. Contrariwise, it's not a good idea to post a link to your code. The code should be in the same thread of discussion, available to anyone who later reads that thread. This should not depend on the availability of some ephemeral pastebin item. Instead, post the code inline; but always compose messages as ?plain text? to avoid too-clever software messing with your program code. -- \ ?I was arrested today for scalping low numbers at the deli. | `\ Sold a number 3 for 28 bucks.? ?Steven Wright | _o__) | Ben Finney From graffatcolmingov at gmail.com Fri Jan 29 17:52:06 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Fri, 29 Jan 2016 16:52:06 -0600 Subject: [code-quality] PyCQA has its own domain now! Message-ID: Hey all, I purchased pycqa.org ~30 minutes ago and set up flake8.pycqa.org and pydocstyle.pycqa.org as tests. Both redirect to the project documentation for those projects. As other PyCQA projects join and existing projects decide they'd like a nifty subdomain, we'll be expanding our usage of the domain. Also, if anyone wants to help out in building a website for pycqa.org, I would love to collaborate with you. For the moment, I'm imagining a static website hosted on GitLab Pages (or if those don't work out, GitHub pages). Cheers, Ian From mustain at adobe.com Fri Jan 29 19:33:52 2016 From: mustain at adobe.com (Elein Mustain) Date: Sat, 30 Jan 2016 00:33:52 +0000 Subject: [code-quality] pylint complaining about undefined parameters Message-ID: Please copy me on any responses. Question: Why is pylint saying my parameters to a function are undefined? $ pylint --version Warning: option include-ids is deprecated and ignored. Warning: option symbols is deprecated and ignored. pylint 1.3.0, astroid 1.4.4, common 1.0.2 Python 2.7.9 (default, Jan 18 2016, 18:45:02) [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] $ python --version Python 2.7.9 --- xxxx.py --- """ Not missing docstring """ def printem(a, b): print a+b if __name__ == '__main__': xxx = "abc" yyy = "def" printem(xxx, yyy) ---- pylint output --- $ pylint xxxx.py Warning: option include-ids is deprecated and ignored. Warning: option symbols is deprecated and ignored. ************* Module xxxx E: 6,10: Undefined variable 'a' (undefined-variable) E: 6,12: Undefined variable 'b' (undefined-variable) ... elein mustain at adobe.com From pcmanticore at gmail.com Sat Jan 30 02:02:35 2016 From: pcmanticore at gmail.com (Claudiu Popa) Date: Sat, 30 Jan 2016 09:02:35 +0200 Subject: [code-quality] pylint complaining about undefined parameters In-Reply-To: References: Message-ID: On Jan 30, 2016 4:45 AM, "Elein Mustain" wrote: > > Please copy me on any responses. > > Question: Why is pylint saying my parameters to a function > are undefined? > > $ pylint --version > Warning: option include-ids is deprecated and ignored. > Warning: option symbols is deprecated and ignored. > pylint 1.3.0, > astroid 1.4.4, common 1.0.2 > Python 2.7.9 (default, Jan 18 2016, 18:45:02) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] > $ python --version > Python 2.7.9 > > --- xxxx.py --- > """ > Not missing docstring > """ > > def printem(a, b): > print a+b > > if __name__ == '__main__': > xxx = "abc" > yyy = "def" > printem(xxx, yyy) > > ---- pylint output --- > $ pylint xxxx.py > Warning: option include-ids is deprecated and ignored. > Warning: option symbols is deprecated and ignored. > ************* Module xxxx > E: 6,10: Undefined variable 'a' (undefined-variable) > E: 6,12: Undefined variable 'b' (undefined-variable) > ... > > > elein mustain at adobe.com > > > > > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality Hi, You need to use the latest version of pylint, 1.5, with astroid 1.4.x, in order for this to work. There are some incompatibilities between older.versions which leads to having this false positive. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ianlee1521 at gmail.com Sat Jan 30 04:04:25 2016 From: ianlee1521 at gmail.com (Ian Lee) Date: Sat, 30 Jan 2016 01:04:25 -0800 Subject: [code-quality] PyCQA has its own domain now! In-Reply-To: References: Message-ID: Awesome! Thanks Ian. Related question I?ve thought about whether we could come up with an avatar for the PyCQA organization, rather then using the default Space Invaders -esque default on GitHub: https://github.com/pycqa > On Jan 29, 2016, at 14:52, Ian Cordasco wrote: > > Hey all, > > I purchased pycqa.org ~30 minutes ago and set up flake8.pycqa.org and > pydocstyle.pycqa.org as tests. Both redirect to the project > documentation for those projects. As other PyCQA projects join and > existing projects decide they'd like a nifty subdomain, we'll be > expanding our usage of the domain. > > Also, if anyone wants to help out in building a website for pycqa.org, > I would love to collaborate with you. For the moment, I'm imagining a > static website hosted on GitLab Pages (or if those don't work out, > GitHub pages). > > Cheers, > Ian > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality ~ Ian Lee | IanLee1521 at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From graffatcolmingov at gmail.com Sat Jan 30 08:28:15 2016 From: graffatcolmingov at gmail.com (Ian Cordasco) Date: Sat, 30 Jan 2016 07:28:15 -0600 Subject: [code-quality] PyCQA has its own domain now! In-Reply-To: References: Message-ID: On Jan 30, 2016 3:04 AM, "Ian Lee" wrote: > > Awesome! Thanks Ian. > > Related question I?ve thought about whether we could come up with an avatar for the PyCQA organization, rather then using the default Space Invaders -esque default on GitHub: https://github.com/pycqa I would love that. If anyone can come up with one, that would be awesome. I would also happily make a tonne of stickers for PyCon this year. ;) -------------- next part -------------- An HTML attachment was scrubbed... URL: From mustain at adobe.com Sat Jan 30 13:45:18 2016 From: mustain at adobe.com (Elein Mustain) Date: Sat, 30 Jan 2016 18:45:18 +0000 Subject: [code-quality] pylint complaining about undefined parameters In-Reply-To: References: , Message-ID: <058AD95E-714F-437D-9826-FE1957890AFF@adobe.com> Thank you. This is helpful. elein mustain at adobe.com 510-637-9106 On Jan 29, 2016, at 11:02 PM, Claudiu Popa > wrote: On Jan 30, 2016 4:45 AM, "Elein Mustain" > wrote: > > Please copy me on any responses. > > Question: Why is pylint saying my parameters to a function > are undefined? > > $ pylint --version > Warning: option include-ids is deprecated and ignored. > Warning: option symbols is deprecated and ignored. > pylint 1.3.0, > astroid 1.4.4, common 1.0.2 > Python 2.7.9 (default, Jan 18 2016, 18:45:02) > [GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] > $ python --version > Python 2.7.9 > > --- xxxx.py --- > """ > Not missing docstring > """ > > def printem(a, b): > print a+b > > if __name__ == '__main__': > xxx = "abc" > yyy = "def" > printem(xxx, yyy) > > ---- pylint output --- > $ pylint xxxx.py > Warning: option include-ids is deprecated and ignored. > Warning: option symbols is deprecated and ignored. > ************* Module xxxx > E: 6,10: Undefined variable 'a' (undefined-variable) > E: 6,12: Undefined variable 'b' (undefined-variable) > ... > > > elein mustain at adobe.com > > > > > _______________________________________________ > code-quality mailing list > code-quality at python.org > https://mail.python.org/mailman/listinfo/code-quality Hi, You need to use the latest version of pylint, 1.5, with astroid 1.4.x, in order for this to work. There are some incompatibilities between older.versions which leads to having this false positive. -------------- next part -------------- An HTML attachment was scrubbed... URL: