Re: A problem with classes - derived type

2016-05-08 Thread Yann Kaiser
If you can't change A to use something like "type(self)(...)" to create its return value, you could use the dark side and swap res's __class__: res.__class__ = B Or: res.__class__ = type(self) Do note that B.__init__ will not be run when you do this, so it is up to you to execute any ad

Re: Is there a reason zip() wipes out data?

2016-05-08 Thread Paul Rubin
DFS writes: > Edit: I see they addressed this in 3.5 (maybe earlier), with an option: > "itertools.zip_longest(*iterables, fillvalue=None) This is available in 2.7 as itertools.izip_longest -- https://mail.python.org/mailman/listinfo/python-list

pygame easy create

2016-05-08 Thread harirammanohar
is there anyway (IDE/package) that allows me to create graphics/game just like that (by instructing..., if i say create hills on the screen, it should generate pygame code)Anyway :) :) -- https://mail.python.org/mailman/listinfo/python-list

Re: Python PygLatin

2016-05-08 Thread Cai Gengyang
I am guessing that the 2 you mentioned are Bill Gates and Larry Ellison ? I heard that they have tons of lawsuits against them in their career (anti-monopoly, anti-competitive laws filed against them both from the government and from individuals) ? Paul Graham has this very interesting related

Re: Is there a reason zip() wipes out data?

2016-05-08 Thread Dan Sommers
On Mon, 09 May 2016 00:22:46 -0400, DFS wrote: > python 2.7.11 docs: "The returned list is truncated in length to the > length of the shortest argument sequence." > > > a = ['who','let','the'] > b = ['dogs','out?'] > c = zip(a,b) > > print c > [('who', 'dogs'), ('let', 'out?')] > > > Wouldn'

Is there a reason zip() wipes out data?

2016-05-08 Thread DFS
python 2.7.11 docs: "The returned list is truncated in length to the length of the shortest argument sequence." a = ['who','let','the'] b = ['dogs','out?'] c = zip(a,b) print c [('who', 'dogs'), ('let', 'out?')] Wouldn't it be better to return an empty element than silently kill your data?

A problem with classes - derived type

2016-05-08 Thread Paulo da Silva
Hi! Suppose I have a class A whose implementation I don't know about. That class A has a method f that returns a A object. class A: ... def f(self, <...>): ... Now I want to write B derived from A with method f1. I want f1 to return a B object: class B(A):

Re: String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-08 Thread srinivas devaki
f be gfdnbh be b GB GB BH GB vbjfhjb GB bffbbubbv GB hbu hbu fjbjfbbbufhbvh VB have fqbgvfb NB bb GB GB GB GB bbu GB vu GB vu GB GB b GB fbufjnb BH GB GB bvvfbubbjubuv GB b fbufbbby GB bfff GB f GB bbbu GB GB ffinj GB vh vh fjb GB fj GB h h GB gjfthey're the b GB gjf GBG GBG q GB fb

Re: String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-08 Thread srinivas devaki
I'm so sorry, forgot to lock my phone. On May 9, 2016 9:01 AM, "srinivas devaki" wrote: > f be gfdnbh be b GB GB BH GB vbjfhjb GB bffbbubbv GB hbu hbu > fjbjfbbbufhbvh VB have fqbgvfb NB bb GB GB GB GB bbu GB vu GB vu GB GB > b GB fbufjnb BH GB GB bvvfbubbjubuv GB b fbufbbby GB bf

Re: pylint woes

2016-05-08 Thread Steven D'Aprano
On Mon, 9 May 2016 07:24 am, DFS wrote: > On 5/8/2016 7:36 AM, Steven D'Aprano wrote: >> On Sun, 8 May 2016 11:16 am, DFS wrote: >> >>> address data is scraped from a website: >>> >>> names = tree.xpath() >>> addr = tree.xpath() >> >> Why are you scraping the data twice? > > > Because it exists

Re: pylint woes

2016-05-08 Thread Steven D'Aprano
On Mon, 9 May 2016 07:04 am, DFS wrote: > On 5/8/2016 11:51 AM, Steven D'Aprano wrote: >> On Mon, 9 May 2016 12:25 am, DFS wrote: >> > for j in range(len(nms)): > cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" > vals = nms[j],street[j],city[j],state[j],zipcd[j] >> >> Why a

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 9:17 PM, Gregory Ewing wrote: Stephen Hansen wrote: The point is, you don't usually commit after an error happens. You rollback. He might want to commit the ones that *did* go in. That's not necessarily wrong. It all depends on the surrounding requirements and workflow. Bingo.

Re: String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 10:44 AM, Thomas 'PointedEars' Lahn wrote: > With the “%” string operator (deprecated), str.format(), and str.Template, > you can use other values in string values even without concatenation. Not deprecated. Don't spread FUD. > Finally, with SQL you should prefer Prepared

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 11:17 AM, Gregory Ewing wrote: > Stephen Hansen wrote: >> >> The point is, you don't usually commit after an error happens. You >> rollback. > > > He might want to commit the ones that *did* go in. > That's not necessarily wrong. It all depends on the > surrounding requireme

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
On 05/08/2016 03:07 PM, Chris Angelico wrote: On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list wrote: On 05/08/2016 06:01 AM, Chris Angelico wrote: [snip...] ... I like to recommend a little thing called "IIDPIO debugging" - If In Doubt, Pr

Re: pylint woes

2016-05-08 Thread Gregory Ewing
Stephen Hansen wrote: The point is, you don't usually commit after an error happens. You rollback. He might want to commit the ones that *did* go in. That's not necessarily wrong. It all depends on the surrounding requirements and workflow. -- Greg -- https://mail.python.org/mailman/listinfo/p

String concatenation (was: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?)

2016-05-08 Thread Thomas 'PointedEars' Lahn
DFS wrote: > sSQL = "line 1\n" > sSQL += "line 2\n" > sSQL += "line 3" What is wrong with it in Python is that it is unnecessarily inefficient. Python has implicit string concatenation if all operands are string literals: #-

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-08 Thread Joel Goldstick
On Sun, May 8, 2016 at 7:10 PM, DFS wrote: > sSQL = "line 1\n" > sSQL += "line 2\n" > sSQL += "line 3" > -- > https://mail.python.org/mailman/listinfo/python-list What is your point DFS? You found pylint, and you don't like what it tells you. Its a tool, and it can tell you some things. Your

Re: Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-08 Thread Tim Chase
While I'm not Steven... On 2016-05-08 19:10, DFS wrote: > sSQL = "line 1\n" > sSQL += "line 2\n" > sSQL += "line 3" If you're only doing it once, it's adequate. If you're doing it within a loop for thing in some_iter(): s = "line1\n" s += "line2\n" s += "line3" use(s, thing)

Steve D'Aprano, you're the "master". What's wrong with this concatenation statement?

2016-05-08 Thread DFS
sSQL = "line 1\n" sSQL += "line 2\n" sSQL += "line 3" -- https://mail.python.org/mailman/listinfo/python-list

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 6:05 PM, Stephen Hansen wrote: On Sun, May 8, 2016, at 02:46 PM, DFS wrote: On 5/8/2016 5:38 PM, Stephen Hansen wrote: On Sun, May 8, 2016, at 02:16 PM, DFS wrote: I was surprised to see the PEP8 guide approve of: "Yes: if x == 4: print x, y; x, y = y, x" https://www.python.org/d

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 3:48 AM, Tim Chase wrote: > On ⅯⅯⅩⅥ-Ⅴ-Ⅷ Ⅹ:ⅩⅩⅤ, Christopher Reimer wrote: >>> Closing line: "In America today, the only thing more terrifying >>> than foreigners is...math." >>> Wonder how close to terrorists pythonists are >> >> I wonder how many Americans are aware that the

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 6:49 AM, Dan Sommers wrote: > On Sun, 08 May 2016 23:01:55 +1000, Chris Angelico wrote: > >> ... I like to recommend a little thing called "IIDPIO debugging" - If >> In Doubt, Print It Out. That means: If you have no idea what a piece >> of code is doing, slap in a print()

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 6:45 AM, Larry Hudson via Python-list wrote: > On 05/08/2016 06:01 AM, Chris Angelico wrote: > [snip...] >> >> ... I like to recommend a >> little thing called "IIDPIO debugging" - If In Doubt, Print It Out. >> That means: If you have

Re: pylint woes

2016-05-08 Thread Stephen Hansen
On Sun, May 8, 2016, at 02:46 PM, DFS wrote: > On 5/8/2016 5:38 PM, Stephen Hansen wrote: > > On Sun, May 8, 2016, at 02:16 PM, DFS wrote: > >> I was surprised to see the PEP8 guide approve of: > >> > >> "Yes: if x == 4: print x, y; x, y = y, x" > >> > >> https://www.python.org/dev/peps/pep-0008/#p

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 5:38 PM, Stephen Hansen wrote: On Sun, May 8, 2016, at 02:16 PM, DFS wrote: I was surprised to see the PEP8 guide approve of: "Yes: if x == 4: print x, y; x, y = y, x" https://www.python.org/dev/peps/pep-0008/#pet-peeves That is not approving of that line of code as something to

Re: pylint woes

2016-05-08 Thread Joel Goldstick
On Sun, May 8, 2016 at 5:24 PM, DFS wrote: > On 5/8/2016 7:36 AM, Steven D'Aprano wrote: >> >> On Sun, 8 May 2016 11:16 am, DFS wrote: >> >>> address data is scraped from a website: >>> >>> names = tree.xpath() >>> addr = tree.xpath() >> >> >> Why are you scraping the data twice? > > > > Because

Re: pylint woes

2016-05-08 Thread Stephen Hansen
On Sun, May 8, 2016, at 02:16 PM, DFS wrote: > I was surprised to see the PEP8 guide approve of: > > "Yes: if x == 4: print x, y; x, y = y, x" > > https://www.python.org/dev/peps/pep-0008/#pet-peeves That is not approving of that line of code as something to mimic, its speaking *only* about *whi

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 7:36 AM, Steven D'Aprano wrote: On Sun, 8 May 2016 11:16 am, DFS wrote: address data is scraped from a website: names = tree.xpath() addr = tree.xpath() Why are you scraping the data twice? Because it exists in 2 different sections of the document. names = tree.xpath('//

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 1:25 PM, Steven D'Aprano wrote: On Sun, 8 May 2016 02:10 pm, DFS wrote: +-++ |bad-whitespace |65 | mostly because I line up = signs: var1 = v

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 11:15 AM, Chris Angelico wrote: On Mon, May 9, 2016 at 1:06 AM, DFS wrote: On 5/8/2016 10:36 AM, Chris Angelico wrote: On Mon, May 9, 2016 at 12:25 AM, DFS wrote: for category,name,street,city,state,zipcode in ziplists: try: db.execute(cSQL, vals) except (pyodbc.Err

Re: pylint woes

2016-05-08 Thread DFS
On 5/7/2016 2:43 PM, Peter Pearson wrote: On Sat, 7 May 2016 12:51:00 -0400, DFS wrote: This more-anal-than-me program generated almost 2 warnings for every line of code in my program. w t hey? Thank you for putting a sample of pylint output in front of my eyes; you inspired me to install py

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 11:51 AM, Steven D'Aprano wrote: On Mon, 9 May 2016 12:25 am, DFS wrote: for j in range(len(nms)): cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" vals = nms[j],street[j],city[j],state[j],zipcd[j] Why are you assigning cSQL to the same string over and over again? I l

Re: pylint woes

2016-05-08 Thread Dan Sommers
On Sun, 08 May 2016 23:01:55 +1000, Chris Angelico wrote: > ... I like to recommend a little thing called "IIDPIO debugging" - If > In Doubt, Print It Out. That means: If you have no idea what a piece > of code is doing, slap in a print() call somewhere. It'll tell you > that (a) the code is actu

Re: pylint woes

2016-05-08 Thread Larry Hudson via Python-list
On 05/08/2016 06:01 AM, Chris Angelico wrote: [snip...] ... I like to recommend a little thing called "IIDPIO debugging" - If In Doubt, Print It Out. That means: If you have no idea what a piece of code is doing, slap in a print() call somewhere. It'll tel

Re: Python PygLatin

2016-05-08 Thread Christopher Reimer
On 5/8/2016 10:53 AM, alister wrote: On Mon, 09 May 2016 03:12:14 +1000, Steven D'Aprano wrote: On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote: If one looks at the Forbes List, you will see that there are 4 programmers amongst the top ten richest people in the world (Bill Gates, Mark Zuckerb

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Christopher Reimer
On 5/8/2016 9:27 AM, Steven D'Aprano wrote: On Sun, 8 May 2016 08:22 pm, beliav...@aol.com wrote: There are far more female than male teachers. I don't attribute it to anti-male suppression but to greater female interest in working with children. Of course there is suppression of male teachers

Re: Help for a complex RE

2016-05-08 Thread Peter Otten
Sergio Spina wrote: > I know about greedy and not-greedy, but the problem remains. This makes me wonder why you had to ask >>> Why the regex engine stops the search at last piece of string? >>> Why not at the first match of the group "@:"? To make it crystal clear this time: >>> import re >>>

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Tim Chase
On ⅯⅯⅩⅥ-Ⅴ-Ⅷ Ⅹ:ⅩⅩⅤ, Christopher Reimer wrote: >> Closing line: "In America today, the only thing more terrifying >> than foreigners is...math." >> Wonder how close to terrorists pythonists are > > I wonder how many Americans are aware that they use Hindu-Arabic > numerals in daily transactions? T

Re: Python PygLatin

2016-05-08 Thread alister
On Mon, 09 May 2016 03:12:14 +1000, Steven D'Aprano wrote: > On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote: > >> If one looks at the Forbes List, you will see that there are 4 >> programmers amongst the top ten richest people in the world (Bill >> Gates, Mark Zuckerberg, Larry Ellison and Jeff

Re: pylint woes

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 02:10 pm, DFS wrote: > I mean I always use tab after : > > The program won't run otherwise. If I use spaces, 100% of the time it > throws: > > IndentationError: unindent does not match any outer indentation level Then you should be more careful about your spaces. If you inde

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Christopher Reimer
On 5/8/2016 8:09 AM, Rustom Mody wrote: See: https://www.washingtonpost.com/news/rampage/wp/2016/05/07/ivy-league-economist-interrogated-for-doing-math-on-american-airlines-flight/ Closing line: "In America today, the only thing more terrifying than foreigners is...math." Wonder how close to

Re: Help for a complex RE

2016-05-08 Thread Terry Reedy
On 5/8/2016 12:32 PM, Sergio Spina wrote: Il giorno domenica 8 maggio 2016 18:16:56 UTC+2, Peter Otten ha scritto: Sergio Spina wrote: In the following ipython session: Python 3.5.1+ (default, Feb 24 2016, 11:28:57) Type "copyright", "credits" or "license" for more information. IPython 2.3.

Re: Python PygLatin

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 08:21 pm, Cai Gengyang wrote: > If one looks at the Forbes List, you will > see that there are 4 programmers amongst the top ten richest people in the > world (Bill Gates, Mark Zuckerberg, Larry Ellison and Jeff Bezos) , a very > large percentage. Science and Technology is in a

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Christopher Reimer
On 5/7/2016 11:58 PM, Marko Rauhamaa wrote: Chris Angelico : So the question is: Do we care about country equality or individual equality? You can't have both. That's why there's been a long-standing initiative to split California into multiple states: https://en.wikipedia.org/wiki/Six_Cal

Re: Pylint prefers list comprehension over filter...

2016-05-08 Thread Christopher Reimer
On 5/8/2016 5:02 AM, Steven D'Aprano wrote: On Sun, 8 May 2016 08:01 am, Christopher Reimer wrote: On 5/7/2016 2:22 PM, Chris Angelico wrote: Also, be sure you read this part of PEP 8: https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds Recrui

Re: Help for a complex RE

2016-05-08 Thread Sergio Spina
Il giorno domenica 8 maggio 2016 18:16:56 UTC+2, Peter Otten ha scritto: > Sergio Spina wrote: > > > In the following ipython session: > > > >> Python 3.5.1+ (default, Feb 24 2016, 11:28:57) > >> Type "copyright", "credits" or "license" for more information. > >> > >> IPython 2.3.0 -- An enhanced

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 08:22 pm, beliav...@aol.com wrote: > There are > far more female than male teachers. I don't attribute it to anti-male > suppression but to greater female interest in working with children. Of course there is suppression of male teachers, particularly but not only for very youn

Re: starting docker container messes up terminal settings

2016-05-08 Thread Larry Martell
On Mon, May 2, 2016 at 10:28 AM, Larry Martell wrote: > On Mon, May 2, 2016 at 10:08 AM, Joaquin Alzola > wrote: >>>I am starting a docker container from a subprocess.Popen and it works, but >>>when the script returns, the terminal settings of my shell are messed up. >>>Nothing is echoed and re

Re: Help for a complex RE

2016-05-08 Thread Peter Otten
Sergio Spina wrote: > In the following ipython session: > >> Python 3.5.1+ (default, Feb 24 2016, 11:28:57) >> Type "copyright", "credits" or "license" for more information. >> >> IPython 2.3.0 -- An enhanced Interactive Python. >> >> In [1]: import re >> >> In [2]: patt = r""" # the match patte

Re: [Python-ideas] Boolean parameters guidelines

2016-05-08 Thread Ian Kelly
On May 8, 2016 9:37 AM, "Steven D'Aprano" wrote: > > Not sure why this has migrated to this list instead of Python-Ideas. Because Gmail has somehow never gotten around to implementing reply-to-list and I'm terrible at choosing the right one. -- https://mail.python.org/mailman/listinfo/python-lis

Re: pylint woes

2016-05-08 Thread Steven D'Aprano
On Mon, 9 May 2016 12:25 am, DFS wrote: >>> for j in range(len(nms)): >>> cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" >>> vals = nms[j],street[j],city[j],state[j],zipcd[j] Why are you assigning cSQL to the same string over and over again? Sure, assignments are cheap, but they're

Re: [Python-ideas] Boolean parameters guidelines

2016-05-08 Thread Steven D'Aprano
Not sure why this has migrated to this list instead of Python-Ideas. Possibly a copy-paste error? *wink* On Mon, 9 May 2016 12:24 am, Ian Kelly wrote: > On May 8, 2016 12:42 AM, "Steven D'Aprano" wrote: >> >> def pvariance(data, mu=None): >> if iter(data) is data: >> data = list(dat

Help for a complex RE

2016-05-08 Thread Sergio Spina
In the following ipython session: > Python 3.5.1+ (default, Feb 24 2016, 11:28:57) > Type "copyright", "credits" or "license" for more information. > > IPython 2.3.0 -- An enhanced Interactive Python. > > In [1]: import re > > In [2]: patt = r""" # the match pattern is: > ...: .+ #

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 1:06 AM, DFS wrote: > On 5/8/2016 10:36 AM, Chris Angelico wrote: >> >> On Mon, May 9, 2016 at 12:25 AM, DFS wrote: >>> >>> for category,name,street,city,state,zipcode in ziplists: >>> try: db.execute(cSQL, vals) >>> except (pyodbc.Error) as programError: >>>

Re: pylint woes

2016-05-08 Thread Stephen Hansen
On Sun, May 8, 2016, at 08:06 AM, DFS wrote: > On 5/8/2016 10:36 AM, Chris Angelico wrote: > > ... and then you just commit???!? > > > > That's what commit() does. > I assure you, he knows what commit does :) The point is, you don't usually commit after an error happens. You rollback. Or correc

Re: pylint woes

2016-05-08 Thread Stephen Hansen
On Sun, May 8, 2016, at 07:25 AM, DFS wrote: > for nm,street,city,state,zipcd in zip(nms,street,city,state,zipcd): > > for vals in zip(nms,street,city,state,zipcd): > > nm,street,city,state,zipcd = vals > > cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" > > > I like the first one bett

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Rustom Mody
On Sunday, May 8, 2016 at 5:38:18 PM UTC+5:30, Steven D'Aprano wrote: > On Sun, 8 May 2016 01:57 am, Marko Rauhamaa wrote: > > > A functional, enlightened, prosperous democracy is a very recent > > historical anomaly. You don't want to jeopardize it naïvely. > > Perhaps by implementing per-countr

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 10:36 AM, Chris Angelico wrote: On Mon, May 9, 2016 at 12:25 AM, DFS wrote: for category,name,street,city,state,zipcode in ziplists: try: db.execute(cSQL, vals) except (pyodbc.Error) as programError: if str(programError).find("UNIQUE constraint failed") > 0:

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Mon, May 9, 2016 at 12:25 AM, DFS wrote: > for category,name,street,city,state,zipcode in ziplists: > try: db.execute(cSQL, vals) > except (pyodbc.Error) as programError: >if str(programError).find("UNIQUE constraint failed") > 0: > dupeRow = True >

Re: pylint woes

2016-05-08 Thread DFS
On 5/7/2016 11:46 PM, Stephen Hansen wrote: On Sat, May 7, 2016, at 08:04 PM, DFS wrote: The lists I actually use are: for j in range(len(nms)): cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" vals = nms[j],street[j],city[j],state[j],zipcd[j] The enumerated version would be: zi

Re: pylint woes

2016-05-08 Thread DFS
On 5/8/2016 1:50 AM, Jussi Piitulainen wrote: DFS writes: The lists I actually use are: for j in range(len(nms)): cSQL = "INSERT INTO ADDRESSES VALUES (?,?,?,?,?)" vals = nms[j],street[j],city[j],state[j],zipcd[j] The enumerated version would be: ziplists = zip(nms,street,city,sta

Re: [Python-ideas] Boolean parameters guidelines

2016-05-08 Thread Ian Kelly
On May 8, 2016 12:42 AM, "Steven D'Aprano" wrote: > > def pvariance(data, mu=None): > if iter(data) is data: > data = list(data) > n = len(data) > if n < 1: > raise StatisticsError('pvariance requires at least one data point') > ss = _ss(data, mu) > T, ss = _ss(

Re: pylint woes

2016-05-08 Thread Peter Otten
DFS wrote: > On 5/7/2016 2:52 PM, Christopher Reimer wrote: >> On 5/7/2016 9:51 AM, DFS wrote: >>> Has anyone ever in history gotten 10/10 from pylint for a non-trivial >>> program? >> >> I routinely get 10/10 for my code. While pylint isn't perfect and >> idiosyncratic at times, it's a useful too

Re: pylint woes

2016-05-08 Thread Peter Otten
Chris Angelico wrote: > On Sun, May 8, 2016 at 1:28 PM, DFS wrote: >> Invalid constant name "cityzip" (invalid-name) >> Invalid constant name "state" (invalid-name) >> Invalid constant name "miles" (invalid-name) >> Invalid constant name "store" (invalid-name) >> Invalid variable name "rs" (inval

Re: pylint woes

2016-05-08 Thread Chris Angelico
On Sun, May 8, 2016 at 10:50 PM, D'Arcy J.M. Cain wrote: > On Sun, 8 May 2016 14:21:49 +1000 > Chris Angelico wrote: >> if verbose: >> verbiage = print >> else: >> def verbiage(*args): pass > > I have never understood why the def couldn't start on the same line as > the else: > > if verbo

Re: pylint woes

2016-05-08 Thread D'Arcy J.M. Cain
On Sun, 8 May 2016 14:21:49 +1000 Chris Angelico wrote: > if verbose: > verbiage = print > else: > def verbiage(*args): pass I have never understood why the def couldn't start on the same line as the else: if verbose: verbiage = print else: def verbiage(*args): pass The colon effectiv

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 01:57 am, Marko Rauhamaa wrote: > A functional, enlightened, prosperous democracy is a very recent > historical anomaly. You don't want to jeopardize it naïvely. Perhaps by implementing per-country limits on immigration? *wink* -- Steven -- https://mail.python.org/mailman

Re: Pylint prefers list comprehension over filter...

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 08:01 am, Christopher Reimer wrote: > On 5/7/2016 2:22 PM, Chris Angelico wrote: >> Also, be sure you read this part of PEP 8: >> >> https://www.python.org/dev/peps/pep-0008/#a-foolish-consistency-is-the-hobgoblin-of-little-minds > Recruiters and hiring managers *are* hobgoblin

Re: pylint woes

2016-05-08 Thread Steven D'Aprano
On Sun, 8 May 2016 11:16 am, DFS wrote: > address data is scraped from a website: > > names = tree.xpath() > addr = tree.xpath() Why are you scraping the data twice? names = addr = tree.xpath() or if you prefer the old-fashioned: names = tree.xpath() addr = names but that raises the questio

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread beliavsky--- via Python-list
On Saturday, May 7, 2016 at 4:02:32 AM UTC-4, Stephen Hansen wrote: > On Fri, May 6, 2016, at 11:43 PM, Gregory Ewing wrote: > > Steven D'Aprano wrote: > > > Who is setting and enforcing this quota, and given that only about 1 in 20 > > > Python programmers is a woman, do you think men are seriousl

Python PygLatin

2016-05-08 Thread Cai Gengyang
I just "clicked" through the lesson on Conditionals and Control Flows and am on the lesson "PygLatin" . This will hopefully be a more interesting and interactive lesson because I will be building a PygLatin Translator ... It seems to me like it will take a long time before I can reach the point

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Steven D'Aprano
On Sunday 08 May 2016 13:40, Random832 wrote: > On Sat, May 7, 2016, at 22:43, Steven D'Aprano wrote: >> > If not for the quotas, a citizen of some other country would have an >> > equal chance to get a green card as a citizen of India or China. >> >> If you have a big hat with 5,000,000 tickets

SQLObject 2.2

2016-05-08 Thread Oleg Broytman
Hello! I'm pleased to announce version 2.2.0, the first stable release of branch 2.2 of SQLObject. What's new in SQLObject === Features & Interface * Add function col.use_microseconds(True/False). Default is to use microseconds (True). * For MSSQL us

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Marko Rauhamaa
Random832 : > But that's not what it is. You would have, say, 1,000 tickets labeled > "green card" and 100,000 tickets labeled "no green card", and (say) > 12,000 Indian people and 50 Finnish people each get their turn drawing > from that same bucket. In your version, the Finnish people draw from a

Re: Python is an Equal Opportunity Programming Language

2016-05-08 Thread Marko Rauhamaa
Chris Angelico : > So the question is: Do we care about country equality or individual > equality? You can't have both. That's why there's been a long-standing initiative to split California into multiple states: https://en.wikipedia.org/wiki/Six_Californias> Each state gets two senate seats,