Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
Brett Cannon wrote: > On Tue, Feb 3, 2009 at 15:50, Tres Seaver wrote: > > -BEGIN PGP SIGNED MESSAGE- > > Hash: SHA1 > > > > Brett Cannon wrote: > >> On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: > >>> I'm just getting ready to start the semester using my new book (Python > >>> Progr

Re: [Python-Dev] Issue 4285 Review

2009-02-03 Thread Ross Light
On Tue, Feb 3, 2009 at 1:20 PM, Aahz wrote: > When sending in a request like this, it's useful to summarize the issue; > few people know bug reports by number, and at least some people who might > be interested in looking probably won't bother if they have no clue > whether it's in their area of e

Re: [Python-Dev] C API for appending to arrays

2009-02-03 Thread Mike Klaas
On 2-Feb-09, at 9:21 AM, Hrvoje Niksic wrote: It turns out that an even faster method of creating an array is by using the fromstring() method. fromstring() requires an actual string, not a buffer, so in C++ I created an std::vector with a contiguous array of doubles, passed that array t

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Brett Cannon
On Tue, Feb 3, 2009 at 15:50, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Brett Cannon wrote: >> On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: >>> I'm just getting ready to start the semester using my new book (Python >>> Programming in Context) and noticed that I

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Daniel (ajax) Diniz
Tres Seaver wrote: > Brett Cannon wrote: >> No because you are getting back the repr for the bytes object. Str >> does not know what the encoding is for the bytes so it has no way of >> performing the decoding. > > The encoding information *is* available in the response headers, e.g.: [snip] That'

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Brett Cannon wrote: > On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: >> I'm just getting ready to start the semester using my new book (Python >> Programming in Context) and noticed that I somehow missed all the changes to >> urllib in python 3.0.

Re: [Python-Dev] Issue 4285 Review

2009-02-03 Thread Eric Smith
Aahz wrote: On Tue, Feb 03, 2009, Ross Light wrote: Hello, python-dev. I submitted a patch a couple weeks ago for Issue 4285, and it has been reviewed and revised. Would someone please review/commit it? Thank you. http://bugs.python.org/issue4285 When sending in a request like this, it's u

Re: [Python-Dev] Issue 4285 Review

2009-02-03 Thread Aahz
On Tue, Feb 03, 2009, Ross Light wrote: > > Hello, python-dev. I submitted a patch a couple weeks ago for Issue > 4285, and it has been reviewed and revised. Would someone please > review/commit it? Thank you. > > http://bugs.python.org/issue4285 When sending in a request like this, it's usefu

Re: [Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Raymond Hettinger
I still haven't seen any real code presented that would benefit from partial.skip or partial_right. # some Articles have timestamp attributes and some don't stamp = partial_right(getattr, 'timestamp', 0) lastupdate = max(map(stamp, articles)) # some beautiful soup nodes have a name attribute an

[Python-Dev] Issue 4285 Review

2009-02-03 Thread Ross Light
Hello, python-dev. I submitted a patch a couple weeks ago for Issue 4285, and it has been reviewed and revised. Would someone please review/commit it? Thank you. http://bugs.python.org/issue4285 Cheers, Ross Light ___ Python-Dev mailing list Python-D

Re: [Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Collin Winter
On Tue, Feb 3, 2009 at 11:53 AM, Antoine Pitrou wrote: > Collin Winter gmail.com> writes: >> >> Have any of the original objections to Calvin's patch >> (http://bugs.python.org/issue1706256) been addressed? If not, I don't >> see anything in these threads that justify resurrecting it. >> >> I sti

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Bill Janssen
İsmail Dönmez wrote: > Hi, > > On Tue, Feb 3, 2009 at 21:56, Brett Cannon wrote: > > Probably the biggest issue will be having to explain string encoding. > > Obviously you can gloss over it or provide students with a simple > > library that just automatically converts the strings. Or even bett

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Benjamin Peterson
On Tue, Feb 3, 2009 at 2:08 PM, Brad Miller wrote: > Here's the iteration problem: > 'b\'>>> for line in page: > print(line) > Traceback (most recent call last): > File "", line 1, in > for line in page: > TypeError: 'addinfourl' object is not iterable > Why is this not iterable anymore? I

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread İsmail Dönmez
Hi, On Tue, Feb 3, 2009 at 21:56, Brett Cannon wrote: > Probably the biggest issue will be having to explain string encoding. > Obviously you can gloss over it or provide students with a simple > library that just automatically converts the strings. Or even better, > provide some code for the sta

Re: [Python-Dev] teaching the new urllib

2009-02-03 Thread Brett Cannon
On Tue, Feb 3, 2009 at 11:08, Brad Miller wrote: > I'm just getting ready to start the semester using my new book (Python > Programming in Context) and noticed that I somehow missed all the changes to > urllib in python 3.0. ARGH to say the least. I like using urllib in the > intro class because

Re: [Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Antoine Pitrou
Collin Winter gmail.com> writes: > > Have any of the original objections to Calvin's patch > (http://bugs.python.org/issue1706256) been addressed? If not, I don't > see anything in these threads that justify resurrecting it. > > I still haven't seen any real code presented that would benefit fro

Re: [Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Calvin Spealman
http://bugs.python.org/issue1706256 Took me a couple days to catch up on this thread so here is the link for any interested. Could it be possible to reevaluate this? On Sat, Jan 31, 2009 at 2:40 PM, Leif Walsh wrote: > On Fri, Jan 30, 2009 at 7:38 PM, Calvin Spealman wrote: >> I am just replyin

[Python-Dev] teaching the new urllib

2009-02-03 Thread Brad Miller
I'm just getting ready to start the semester using my new book (Python Programming in Context) and noticed that I somehow missed all the changes to urllib in python 3.0. ARGH to say the least. I like using urllib in the intro class because we can get data from places that are more interesting/mot

[Python-Dev] teaching the new urllib

2009-02-03 Thread Brad Miller
I'm just getting ready to start the semester using my new book (Python Programming in Context) and noticed that I somehow missed all the changes to urllib in python 3.0. ARGH to say the least. I like using urllib in the intro class because we can get data from places that are more interesting/mot

Re: [Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Collin Winter
On Tue, Feb 3, 2009 at 5:44 AM, Ben North wrote: > Hi, > > Thanks for the further responses. Again, I'll try to summarise: > > Scott David Daniels pointed out an awkward interaction when chaining > partial applications, such that it could become very unclear what was > going to happen when the fi

Re: [Python-Dev] [patch] Duplicate sections detection in ConfigParser

2009-02-03 Thread Raghuram Devarakonda
>> The attached patch is compatible with both the 2.x and the 3.x >> branches; it adds a `unique_sects` parameter to the constructor of >> RawConfigParser and a test in the parser loop that raises >> DuplicateSectionError if a section is seen more then once and that >> unique_sects is True. http:/

Re: [Python-Dev] [patch] Duplicate sections detection in ConfigParser

2009-02-03 Thread Aahz
On Tue, Feb 03, 2009, Yannick Gingras wrote: > > The attached patch is compatible with both the 2.x and the 3.x > branches; it adds a `unique_sects` parameter to the constructor of > RawConfigParser and a test in the parser loop that raises > DuplicateSectionError if a section is seen more then onc

[Python-Dev] Partial function application 'from the right'

2009-02-03 Thread Ben North
Hi, Thanks for the further responses. Again, I'll try to summarise: Scott David Daniels pointed out an awkward interaction when chaining partial applications, such that it could become very unclear what was going to happen when the final function is called: > If you have: > def button(root,

Re: [Python-Dev] Should there be a source-code checksum in module objects?

2009-02-03 Thread rocky
Guido van Rossum writes: > I suggest that you move this discussion to python-ideas to ferret out > a possible implementation and API; or to find out work-arounds. Okay. Done. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mai

Re: [Python-Dev] C API for appending to arrays

2009-02-03 Thread Hrvoje Niksic
Raymond Hettinger wrote: [Hrvoje Niksic] The one thing missing from the array module is the ability to directly access array values from C. Please put a feature request on the bug tracker. Done, http://bugs.python.org/issue5141 ___ Python-Dev mail