Re: Dict comprehensions - improvement to docs?

2015-03-15 Thread Ben Finney
"Frank Millman" writes: > This is what the library reference says about lists - […] > If you did not know about dict comprehensions, there is nothing to > tell you that they even exist. > > I feel that it should be mentioned. It *is* mentioned, but not in the standard library documentation. Com

Re: Dict comprehensions - improvement to docs?

2015-03-15 Thread Frank Millman
"Ian Kelly" wrote in message news:CALwzidnTUifj_L=DSH_8s+z0L44pxVvdpG1+pfz1Tzm=ect...@mail.gmail.com... > On Sun, Mar 15, 2015 at 11:25 PM, Frank Millman > wrote: >> Hi all >> >> I like dict comprehensions, but I don't use them very often, so when I do >> I >> need to look up the format. > [.

Re: You must register a new account to report a bug (was: Python 2 to 3 conversion - embrace the pain)

2015-03-15 Thread Devin Jeanpierre
On Sun, Mar 15, 2015 at 11:17 PM, Ben Finney wrote: > Sadly becoming the norm. People will run a software project and just > assume that users will be willing to go through a registration process > for every project just to report a bug. Registering for github is a lot easier than creating a repr

Re: Dict comprehensions - improvement to docs?

2015-03-15 Thread Paul Rubin
"Frank Millman" writes: > I like dict comprehensions, but I don't use them very often, so when I do I > need to look up the format. I never felt a need for them. Do they generate better code than d = dict((k,v) for k,v in [('name','paul'),('language','python')]) ? Anyway, since they are s

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Paul Rubin
Chris Angelico writes: > Ah but it isn't Py3 that's all about being first - it's the latest > version of some third-party module. You know, one of the attractions of Python used to be that it came with a powerful enough standard library that you didn't really need third party modules very often.

Re: Dict comprehensions - improvement to docs?

2015-03-15 Thread Ian Kelly
On Sun, Mar 15, 2015 at 11:25 PM, Frank Millman wrote: > Hi all > > I like dict comprehensions, but I don't use them very often, so when I do I > need to look up the format. This surprises me, because I find the syntax very intuitive, at least if you regularly use other kinds of comprehensions. I

You must register a new account to report a bug (was: Python 2 to 3 conversion - embrace the pain)

2015-03-15 Thread Ben Finney
Cameron Simpson writes: > To quote Graham Dumpleton: > > For years have seen people make vague grumbles about something not > working with mod_wsgi. Not one ever reported bug or described problem. Hmm. How easy is it for someone who, say, an hour ago had no idea they would ever want to contact

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 4:07 PM, Paul Rubin wrote: > Python 2 is by now pretty solid and its users don't feel like beta > testers any more. If you're saying using Python 3 by contrast means > "being first" and "reporting bugs", that basically translates to "stay > away from it except for experime

Dict comprehensions - improvement to docs?

2015-03-15 Thread Frank Millman
Hi all I like dict comprehensions, but I don't use them very often, so when I do I need to look up the format. I always struggle to find the information in the Library Reference. The obvious location, Mapping Types, shows various constructors, but not the comprehension. https://docs.python.or

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Paul Rubin
Chris Angelico writes: >>> Solution: Use it! Do the port to Python 3, and file those upstream >>> bug reports. >> One should mention that John did all of that. > Yep. I'm not saying that John did the wrong thing; what I'm saying is > that, sometimes, this kind of pain is the exact thing that makes

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 1:53 PM, Cameron Simpson wrote: >> I would say that time clearly isn't the issue. Nine years IS enough... >> if it's a matter of time. But since the bugs are still there, it means >> that the problem is a lack of usage. Solution: Use it! Do the port to >> Python 3, and file

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Cameron Simpson
On 16Mar2015 11:38, Chris Angelico wrote: On Mon, Mar 16, 2015 at 11:25 AM, Steven D'Aprano wrote: "Some of the bugs I listed are so easy to hit that I suspect those packages aren't used much. Those bugs should have been found years ago. Fixed, even. I shouldn't be discovering them in 2015.

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Mark Lawrence
On 16/03/2015 00:25, Steven D'Aprano wrote: Mark Lawrence wrote: On 15/03/2015 20:59, Fetchinson . wrote: On 3/15/15, Mark Lawrence wrote: On 15/03/2015 19:05, John Nagle wrote: On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: John Nagle : I'm approaching the end of converting a large sys

Re: generator/coroutine terminology

2015-03-15 Thread Steven D'Aprano
Marko Rauhamaa wrote: > Chris Angelico : > >> On Sun, Mar 15, 2015 at 9:15 AM, Marko Rauhamaa wrote: >>> Is it necessary/useful for a Python application programmer to be >>> conscious of the different types of iterator? What mistaken usage >>> could arise if the application just treated all iter

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 11:25 AM, Steven D'Aprano wrote: > "Some of the bugs I listed are so easy to hit that I suspect those > packages aren't used much. Those bugs should have been found years > ago. Fixed, even. I shouldn't be discovering them in 2015." > > Clearly a mere nine years is NOT l

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Steven D'Aprano
Mark Lawrence wrote: > On 15/03/2015 20:59, Fetchinson . wrote: >> On 3/15/15, Mark Lawrence wrote: >>> On 15/03/2015 19:05, John Nagle wrote: On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: > John Nagle : >> I'm approaching the end of converting a large system from Python >>

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Mario Figueiredo
On Sun, 15 Mar 2015 19:43:38 -0400, Roy Smith wrote: > >The big problem continues to be the legacy projects. People made >decisions years ago about what packages to use, and those decisions are >hard to get away from. There is a lot of production code out there >which still uses third-party

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 10:43 AM, Roy Smith wrote: > The big problem continues to be the legacy projects. People made > decisions years ago about what packages to use, and those decisions are > hard to get away from. There is a lot of production code out there > which still uses third-party pack

Setuptools: no module named 'html.entities'

2015-03-15 Thread Jason Friedman
Hello, This is Python 3.3.2 on Linux. I downloaded Setuptools ( https://pypi.python.org/packages/source/s/setuptools/setuptools-14.3.tar.gz), exploded the tarball, and I get: python setup.py build Traceback (most recent call last): File "", line 1521, in _find_and_load_unlocked AttributeError:

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Roy Smith
In article , Mario Figueiredo wrote: > What makes you think your anedoctal bugs constitute any sort of > evidence this programming language isn't ready to be used by the > public? There's several levels of "ready". I'm sure the core language is more than ready for production use for a project

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Mario Figueiredo
On Sun, 15 Mar 2015 12:05:21 -0700, John Nagle wrote: >On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: > >Some of the bugs I listed are so easy to hit that I suspect those >packages aren't used much. Those bugs should have been found years >ago. Fixed, even. I shouldn't be discovering them in

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Mark Lawrence
On 15/03/2015 20:59, Fetchinson . wrote: On 3/15/15, Mark Lawrence wrote: On 15/03/2015 19:05, John Nagle wrote: On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: John Nagle : I'm approaching the end of converting a large system from Python 2 to Python 3. Here's why you don't want to do this.

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Fetchinson .
On 3/15/15, Mark Lawrence wrote: > On 15/03/2015 19:05, John Nagle wrote: >> On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: >>> John Nagle : I'm approaching the end of converting a large system from Python 2 to Python 3. Here's why you don't want to do this. >>> >>> A nice report, thanks

Re: More or less code in python?

2015-03-15 Thread Peter Otten
jonas.thornv...@gmail.com wrote: >

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread Mark Lawrence
On 15/03/2015 19:05, John Nagle wrote: On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: John Nagle : I'm approaching the end of converting a large system from Python 2 to Python 3. Here's why you don't want to do this. A nice report, thanks. Shows that the slowness of Python 3 adoption is not o

Re: More or less code in python?

2015-03-15 Thread jonas . thornvall
Den söndag 15 mars 2015 kl. 20:01:36 UTC+1 skrev Paul Rubin: > jonas.thornv...@gmail.com writes: > > I though it would be interesting doing comparissons in timing adding > > massive digits in different bases. Especially in Python. > > Python has built-in bignums. Try "print 2**500". I will try i

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread John Nagle
On 3/14/2015 1:00 AM, Marko Rauhamaa wrote: > John Nagle : >> I'm approaching the end of converting a large system from Python 2 >> to Python 3. Here's why you don't want to do this. > > A nice report, thanks. Shows that the slowness of Python 3 adoption is > not only social inertia. > Marko

Re: More or less code in python?

2015-03-15 Thread jonas . thornvall
Den söndag 15 mars 2015 kl. 20:01:36 UTC+1 skrev Paul Rubin: > jonas.thornv...@gmail.com writes: > > I though it would be interesting doing comparissons in timing adding > > massive digits in different bases. Especially in Python. > > Python has built-in bignums. Try "print 2**500". I know. --

Re: More or less code in python?

2015-03-15 Thread Paul Rubin
jonas.thornv...@gmail.com writes: > I though it would be interesting doing comparissons in timing adding > massive digits in different bases. Especially in Python. Python has built-in bignums. Try "print 2**500". -- https://mail.python.org/mailman/listinfo/python-list

Re: More or less code in python?

2015-03-15 Thread jonas . thornvall
Den söndag 15 mars 2015 kl. 19:32:02 UTC+1 skrev Joel Goldstick: > On Sun, Mar 15, 2015 at 2:07 PM, wrote: > > > > > > function naiveAdd(base,arrOne,arrTwo) { > > if (arrOne.length>=arrTwo.length) {length=arrOne.length;} else > > {length=arrTwo.length;} > > out=""; > > remainder=0; > > for (i=0

Re: More or less code in python?

2015-03-15 Thread jonas . thornvall
Den söndag 15 mars 2015 kl. 19:32:02 UTC+1 skrev Joel Goldstick: > On Sun, Mar 15, 2015 at 2:07 PM, wrote: > > > > > > function naiveAdd(base,arrOne,arrTwo) { > > if (arrOne.length>=arrTwo.length) {length=arrOne.length;} else > > {length=arrTwo.length;} > > out=""; > > remainder=0; > > for (i=0

Re: More or less code in python?

2015-03-15 Thread Joel Goldstick
On Sun, Mar 15, 2015 at 2:07 PM, wrote: > > > function naiveAdd(base,arrOne,arrTwo) { > if (arrOne.length>=arrTwo.length) {length=arrOne.length;} else > {length=arrTwo.length;} > out=""; > remainder=0; > for (i=0;i one=arrOne[i]; > two=arrTwo[i]; > one=parseInt(one); > two=parseI

More or less code in python?

2015-03-15 Thread jonas . thornvall
function naiveAdd(base,arrOne,arrTwo) { if (arrOne.length>=arrTwo.length) {length=arrOne.length;} else {length=arrTwo.length;} out=""; remainder=0; for (i=0;i

Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-15 Thread Alan Hicks
On 15/03/2015 15:52, Chris Angelico wrote: On Mon, Mar 16, 2015 at 1:10 AM, Alan Hicks wrote: If issues are not surfacing it is more likely that both SPF and DKIM are not strong spam indicators rather than there are no issues. SPF is rarely implemented decisively ~all instead of -all so is not

Re: PSF news - BBC launches MicroBit

2015-03-15 Thread MRAB
On 2015-03-15 07:26, Dave Farrance wrote: Mark Lawrence wrote: http://pyfound.blogspot.co.uk/2015/03/bbc-launches-microbit.html may be of interest to some of you. "Python is one of the three languages that work with the device." That's cool, and the article says that the Raspberry Pi Founda

Re: Help me please urgently!

2015-03-15 Thread Ian Kelly
On Sun, Mar 15, 2015 at 9:43 AM, Jenny Hale wrote: > Hi > > How would I do this? > The teacher wants to keep track of the scores each member of the class > obtains in the quiz. There are three classes in the school and the data > should be kept separately for each class. Is this a homework assi

[Fwd: Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI]

2015-03-15 Thread Alan Hicks
Original Message Subject: Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI From:"Alan Hicks" Date:Sun, March 15, 2015 2:10 pm To: "Chris Angelico" -

Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-15 Thread Alan Hicks
On 13/03/2015 11:58, Chris Angelico wrote: On Mon, Mar 9, 2015 at 9:16 PM, Alan Hicks wrote: With defending reputations as important as receiving email I'm pleased to announce another beta of django-dmarc 0.1.3 is released to PyPI. https://pypi.python.org/pypi/django-dmarc The Django DMARC pro

Re: Help me please urgently!

2015-03-15 Thread Chris Angelico
On Mon, Mar 16, 2015 at 2:43 AM, Jenny Hale wrote: > How would I do this? > The teacher wants to keep track of the scores each member of the class > obtains in the quiz. There are three classes in the school and the data > should be kept separately for each class. > Thank you for being honest a

Help me please urgently!

2015-03-15 Thread Jenny Hale
Hi How would I do this? The teacher wants to keep track of the scores each member of the class obtains in the quiz. There are three classes in the school and the data should be kept separately for each class. Here is my code: import random import operator MATHS_OPERATIONS = [ (operator.a

Re: Odd ValueError using float

2015-03-15 Thread Peter Otten
emile wrote: > On 03/14/2015 11:24 AM, Peter Otten wrote: >> emile wrote: >> >>> On 03/14/2015 09:08 AM, Peter Otten wrote: > Why are you checking int(decval) >>> >>> >>> because it sure smells like int should work: >>> >>> (Pdb) "3">> True >> >> That's a normal string comparison w

Re: Django-DMARC making it easier to manage DMARC reports - Beta 0.1.3 on PyPI

2015-03-15 Thread Chris Angelico
On Sun, Mar 15, 2015 at 11:20 PM, Alan Hicks wrote: > Mailing lists are an issue on many levels, and dmarc has an faq that may > help http://dmarc.org/faq/receivers/#r_2 No, they're not; the issue is only with DMARC. I have no problems with mailing lists and SPF records, because the list software

Re: Odd ValueError using float

2015-03-15 Thread random832
On Sat, Mar 14, 2015, at 18:09, Cameron Simpson wrote: > >So there's still something amiss. > > Am I missing something obvious here? int() likes only ints, not floats: What you're missing is that when directly examined in pdb, the value appeared to be '4', but then when passed to the int construc

Re: Pexpect idea - but can I handle curses?

2015-03-15 Thread Thomas 'PointedEars' Lahn
Skip Montanaro wrote: >> That might have to do with >> , specifically >> . > > Thanks, but not really helpful. I'm well aware of Eric Raymond's > contributions to the open source world. I

Re: generator/coroutine terminology

2015-03-15 Thread Steven D'Aprano
Rustom Mody wrote: > On Saturday, March 14, 2015 at 11:34:27 AM UTC+5:30, Steven D'Aprano > wrote: >> >> A generator (function) may be a function which returns an iterator,... > > I find "generator-function" misleading in the same way that "pineapple" > misleadingly suggests "apple that grows on

Re: PSF news - BBC launches MicroBit

2015-03-15 Thread Dave Farrance
Mark Lawrence wrote: >http://pyfound.blogspot.co.uk/2015/03/bbc-launches-microbit.html may be >of interest to some of you. "Python is one of the three languages that work with the device." That's cool, and the article says that the Raspberry Pi Foundation is involved in creating learning conte

Re: Python 2 to 3 conversion - embrace the pain

2015-03-15 Thread INADA Naoki
What I want to say is, MySQLdb -> PyMySQL conversion is not required for porting from Python 2 to Python 3. mysqlclient is straight upgrade path from MySQLdb. On Sat, Mar 14, 2015 at 8:01 AM, John Nagle wrote: > On 3/13/2015 3:27 PM, INADA Naoki wrote: >> Hi, John. I'm maintainer of PyMySQL. >>