Re: [Python-Dev] PEP 0404 and VS 2010

2013-11-21 Thread Chris Barker
now". """ I don't know what SOABI is, but it soudns like that defines what should be in the abi tag... But the platfrom tag is: macosx_10_6_i386.whl macosx -- natch' 10_6 -- built for the 10.6 SDK (I'm running 10.7...) i386 -- I've hacked my build to be

Re: [Python-Dev] PEP 0404 and VS 2010

2013-11-22 Thread Chris Angelico
On Fri, Nov 22, 2013 at 10:32 PM, Nick Coghlan wrote: > A few folks overreacted in their concern about the community confusion > such a move would inevitably create - *anything* called "Python 2.8" > is going to give the impression that we've changed our mind about 2.7 > being the last feature rel

Re: [Python-Dev] PEP process entry point and ill fated initiatives

2013-11-29 Thread Chris Angelico
On Fri, Nov 29, 2013 at 10:08 PM, anatoly techtonik wrote: > About ill fated initiatives. I don't like when people prematurely close > tickets > without waiting for the mutual agreement that the problem is solved. Perhaps > trackers should have personal "agree/disagree/meh" flags to help other >

Re: [Python-Dev] Running the unit test as root/administrator

2013-12-05 Thread Chris Angelico
On Fri, Dec 6, 2013 at 2:29 AM, "Martin v. Löwis" wrote: > Am 05.12.13 16:21, schrieb Vajrasky Kok: >> On Thu, Dec 5, 2013 at 11:06 PM, "Martin v. Löwis" >> wrote: >>> >>> Can you please phrase your question more explicit? What is it that >>> you want to be done before writing unit tests for the

[Python-Dev] Buildbot running Debian amd64 as root

2013-12-07 Thread Chris Angelico
In another thread it was suggested that a new buildbot running as root would be of value. I've spun up a virtual machine running Debian Wheezy amd64, have installed buildbot from the repository (version 0.8.6p1), and am ready to have it join the farm. How do I go about doing this? I've followed th

Re: [Python-Dev] Backward-incompatible change to random.randrange in 2.7.6

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 8:43 PM, Serhiy Storchaka wrote: > 18.12.13 04:40, Benjamin Peterson написав(ла): > >> Mostly yes, but at least you could tell people to upgrade straight to >> 2.7.7 and skip 2.7.6. > > > It'll make the people to postpone the upgrade to 2.7.6 (which fixes many > security bu

Re: [Python-Dev] thread issues when embedding Python

2013-12-18 Thread Chris Angelico
On Wed, Dec 18, 2013 at 9:26 PM, Daniel Pocock wrote: > b) when each worker thread starts, call > PyThreadState_New(mInterpreterState) and save the result in a thread > local mPyThreadState > > c) use the mPyThreadState with PyEval_RestoreThread and > PyEval_SaveThread before and after calling Py

Re: [Python-Dev] Buildbot running Debian amd64 as root

2013-12-30 Thread Chris Angelico
On Sun, Dec 8, 2013 at 12:35 AM, Chris Angelico wrote: > In another thread it was suggested that a new buildbot running as root > would be of value. I've spun up a virtual machine running Debian > Wheezy amd64, have installed buildbot from the repository (version > 0.8.6p1), and

Re: [Python-Dev] Buildbot running Debian amd64 as root

2013-12-30 Thread Chris Angelico
On Tue, Dec 31, 2013 at 12:05 AM, Chris Angelico wrote: > On Sun, Dec 8, 2013 at 12:35 AM, Chris Angelico wrote: >> In another thread it was suggested that a new buildbot running as root >> would be of value. I've spun up a virtual machine running Debian >> Wheezy amd6

Re: [Python-Dev] Buildbot running Debian amd64 as root

2013-12-30 Thread Chris Angelico
On Tue, Dec 31, 2013 at 5:18 AM, Christian Heimes wrote: > The buildbot is missing some vital header files. Please run: > > # apt-get build-dep python3.3 > > to install all required dependencies. Debian Wheezy doesn't package 3.3 but only 3.2, so I grabbed 3.2's build-deps. They're now installe

[Python-Dev] Buildbot - "slave lost"

2013-12-30 Thread Chris Angelico
Does Buildbot retain a constant TCP socket to its server? I'm seeing this: http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.3/builds/0 """ Results: Retry exception slave lost """ I have two internet connections; one is faster, but tends to drop socket connections after a few

Re: [Python-Dev] Buildbot - "slave lost"

2013-12-30 Thread Chris Angelico
On Tue, Dec 31, 2013 at 11:42 AM, Antoine Pitrou wrote: > On Tue, 31 Dec 2013 11:24:26 +1100 > Chris Angelico wrote: >> Does Buildbot retain a constant TCP socket to its server? I'm seeing this: >> >> http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.

Re: [Python-Dev] Buildbot running Debian amd64 as root

2013-12-30 Thread Chris Angelico
On Tue, Dec 31, 2013 at 12:35 PM, Zach Ware wrote: >>Debian Wheezy doesn't package 3.3 but only 3.2, so I grabbed 3.2's >>build-deps. They're now installed, so the next build should have >>everything for that. Does anyone happen to know what (if anything) 3.3 >>needs that 3.2 doesn't? > > You'll n

Re: [Python-Dev] Fwd: Python 2.x and 3.x usage survey

2013-12-31 Thread Chris Barker
into the wild more and see what happens... -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception chris.ba

Re: [Python-Dev] Buildbot - "slave lost"

2014-01-01 Thread Chris Angelico
On Thu, Jan 2, 2014 at 9:17 AM, "Martin v. Löwis" wrote: > So it should be able to handle a failover from one link to > the other, but it's certainly better to bind it to the more > reliable transport. I believe you can somehow configure the > frequency of ping messages so that you network doesn't

Re: [Python-Dev] 2.x vs 3.x survey results

2014-01-02 Thread Chris Angelico
On Fri, Jan 3, 2014 at 1:18 PM, Dan Stromberg wrote: > I don't know much (if anything ^_^) about survey methodology. I just > created a 9 question survey and tossed it at a few places that > Pythonistas hang out. Specifically, your methodology was to post the link to python-list and python-dev (

Re: [Python-Dev] Bug? http.client assumes iso-8859-1 encoding of HTTP headers

2014-01-04 Thread Chris Angelico
On Sun, Jan 5, 2014 at 2:36 AM, Hugo G. Fierro wrote: > I am trying to download an HTML document. I get an HTTP 301 (Moved > Permanently) with a UTF-8 encoded Location header and http.client decodes it > as iso-8859-1. When there's a non-ASCII character in the redirect URL then I > can't download

[Python-Dev] Python 2.7 root buildbot showing errors

2014-01-05 Thread Chris Angelico
The first build my new root buildbot did showed errors in the 2.7 test suite, but I thought little of it as quite a few other 2.7 buildbots are showing red, too. But it seems they're showing different errors, so there might be something wrong with the setup. http://buildbot.python.org/all/builders

Re: [Python-Dev] Python 2.7 root buildbot showing errors

2014-01-06 Thread Chris Angelico
On Mon, Jan 6, 2014 at 7:11 PM, Christian Heimes wrote: > On 06.01.2014 08:09, Chris Angelico wrote: >> >> Then further down, several SSL tests attempt: >> >> s.connect_ex(("svn.python.org", 444))) >> >> and get back EAGAIN when they're expe

Re: [Python-Dev] Python 2.7 root buildbot showing errors

2014-01-06 Thread Chris Angelico
On Mon, Jan 6, 2014 at 7:58 PM, Christian Heimes wrote: > Interesting, maybe it's a general NAT issue? So far I have seen the issue on > Windows only. What kind of VM are you using? I'm using virtualbox for my > Windows VMs. It's Oracle VirtualBox v4.2.20 r90963. > Just backport the test fixes.

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-06 Thread Chris Angelico
On Tue, Jan 7, 2014 at 12:44 AM, Antoine Pitrou wrote: > BTW, there's a subtlety here: ``%s`` currently means "insert the result > of calling __str__", but bytes formatting should *not* call __str__. Since it derives from the C printf notation, it means "insert string here". The fact that __str__

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-08 Thread Chris Angelico
On Wed, Jan 8, 2014 at 9:12 PM, Victor Stinner wrote: > IMO some formatting commands must not be implemented. For example, > alignment is used to display something on screen, not in network > protocols or binary file formats. Must not, or need not? I can understand that those sorts of features wo

Re: [Python-Dev] Python3 "complexity"

2014-01-08 Thread Chris Angelico
On Thu, Jan 9, 2014 at 11:21 AM, MRAB wrote: > On the other hand: > > "I need a new battery." > > "What kind of battery?" > > "I don't care!" Or, bringing it back to Python: How do you write a set out to a file? foo = {1, 2, 4, 8, 16, 32} open("foo.txt","w").write(foo) # Uh... nope!

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Angelico
On Thu, Jan 9, 2014 at 5:50 PM, Lennart Regebro wrote: > To be honest, you can define text as "A stream of bytes that are split > up in lines separated by a linefeed", and do some basic text > processing like that. Just very *basic*, but still. Replacing > characters. Extracting certain lines etc.

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Barker
This has all gotten a bit complicated because everyone has been thinking in terms of actual encodings and actual text files. But I think the use-case here is something different: A file with a bunch of bytes in it, _some_of which are ascii, and the rest are other bytes (maybe binary data, maybe no

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Barker
a documentation issue, after all. I know I learned something. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Barker
2 = u.replace('a name', 'a different name') In [28]: b2 = u2.encode('latin-1') In [29]: b2 Out[29]: '\x01\x00\xd1\x80\xd1a different name\xd0\x80' -Chris > Please don't take away the message that latin1 makes things > "just like Py

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Barker
inary -- i.e. passed to the struct module, or to a frombytes() or frombuffer() method of say numpy, or PIL or something... But I'm no expert -Chris > > -- > ~Ethan~ > > ___ > Python-Dev mailing list > Python-D

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Angelico
On Fri, Jan 10, 2014 at 11:53 AM, anatoly techtonik wrote: > 2. introduce autodetect mode to open functions > 1. read and transform on the fly, maintaining a buffer that > stores original bytes > and their mapping to letters. The mapping is updated as bytes > frequency >

Re: [Python-Dev] Python3 "complexity"

2014-01-09 Thread Chris Angelico
On Fri, Jan 10, 2014 at 1:39 PM, Steven D'Aprano wrote: > On Fri, Jan 10, 2014 at 12:22:02PM +1100, Chris Angelico wrote: >> On Fri, Jan 10, 2014 at 11:53 AM, anatoly techtonik >> wrote: >> > 2. introduce autodetect mode to open functions >> >

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-10 Thread Chris Barker
.encode('latin-1') dumping the binary data in would be a bit uglier, for teh image example: stream ...binary image data... endstream endobj u"stream\n%s\nendstream\nendobj"%binary_data.decode('latin-1') I think. not too bad, though if n

Re: [Python-Dev] Python3 "complexity"

2014-01-10 Thread Chris Barker
to do that -- at least not an efficient or easy to read and write one. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, W

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-10 Thread Chris Barker
ode gets encoded back to latin-1, the original bytes are preserved. I think this it confusing, as we are calling it latin-1, but not really using it that way, but it seems it should work. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R

Re: [Python-Dev] Python3 "complexity"

2014-01-10 Thread Chris Barker
es are binary, or maybe the next bytes are binary until you get to this ascii text, etc... This is not guessing, but it does require working with an object which has both ascii text and binary in it -- and why shouldn't Python provide a reasonable way to work with that? -Chris -- Christopher B

Re: [Python-Dev] RFC: PEP 460: Add bytes % args and bytes.format(args) to Python 3.5

2014-01-12 Thread Chris Angelico
On Mon, Jan 13, 2014 at 4:57 AM, Juraj Sukop wrote: > On Sun, Jan 12, 2014 at 6:22 PM, Steven D'Aprano > wrote: >> First, "utf16_string" confuses me. What is it? If it is a Unicode >> string, i.e.: > > It is a Unicode string which happens to contain code points outside U+00FF > (as with the TTF e

Re: [Python-Dev] Automatic encoding detection [was: Re: Python3 "complexity" - 2 use cases]

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 10:48 AM, Jim J. Jewett wrote: >> The barrier for entry to the standard library is higher than mere >> usefulness. > > Agreed. But "most programs will need it, and people will either > include (the same) 3rd-party library themselves, or write their > own workaround, or hav

[Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
And now for something completely different. My root buildbot is finally now able to telnet out and get "Connection refused" errors. (For the curious, the VirtualBox "NAT" mode doesn't work properly, but the new "NAT Network" mode does. Why? I have no idea. But if anyone else is having the same pro

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:14 PM, Zachary Ware wrote: > On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico wrote: >> And secondly, how can I run the tests manually? I can't find a binary >> inside the buildarea tree. Does it get deleted afterward? > > Yes, that's t

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:03 PM, Terry Reedy wrote: > On 1/13/2014 7:48 PM, Chris Angelico wrote: >> >> ValueError: max() arg is an empty sequence > > > try: > > g = max(self.saved_groups) + 1 > except ValueError: > g = 1 > > > Unless someone

Re: [Python-Dev] Test failures when running as root

2014-01-13 Thread Chris Angelico
On Tue, Jan 14, 2014 at 2:16 PM, MRAB wrote: > Alternatively: > > g = max(self.saved_groups, [1]) > > or even: > > g = max(self.saved_groups or [1]) Patch created and tracker issue opened. I've used something similar to MRAB's idea as it looks compact. Thanks all! http://bugs.python.org/issue202

Re: [Python-Dev] PEP 460 reboot

2014-01-14 Thread Chris Barker
values in the first place... Ease of porting is nice, but let's not make it easy to port bug-prone code. -Chris > > This way *most* of the use cases of python2 will be covered without > touching the code. So: > > - b’Hello {}’.format(‘world’) >will be the same as

Re: [Python-Dev] Common subset of python 2 and python 3

2014-01-15 Thread Chris Angelico
On Wed, Jan 15, 2014 at 11:22 PM, "Martin v. Löwis" wrote: > I don't think that it is possible to write an interpreter that is fully > compatible for all it accepts. Would you think that the program > > print(repr(2**80).endswith("L")) > > is in the subset that should be supported by both Python 2

Re: [Python-Dev] Common subset of python 2 and python 3

2014-01-15 Thread Chris Angelico
On Thu, Jan 16, 2014 at 1:25 AM, Eric V. Smith wrote: >> Easiest fix for that would be to have long.__repr__ omit the L tag. >> Then it'll do the same as it would in Py3. > > I think Martin's point is not this specific thing, but that such a > subset would be useless. Would you drop dict.items() b

Re: [Python-Dev] PEP 461 updates

2014-01-17 Thread Chris Barker
""" The use of asbytes originates only from the fact that b'%d' % (20,) does not work. """ So yeah PEP 461! (even if too late for numpy...) -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(20

Re: [Python-Dev] PEP 461 updates

2014-01-17 Thread Chris Barker
about the extra slashes) And this ascii text -- it gets worse if there is non-ascii text in there. Anyway, the truth is, this stuff is hard, but it will get at least a touch easier with PEP 461. [though to be truthful, I'm not sure why someone put a comment in the issue tracker about b'

Re: [Python-Dev] PEP 461 Final?

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 12:51 PM, Ethan Furman wrote: > It seems there are two possibilities with %a: > > 1) have it be ascii(repr(obj)) Wouldn't that be redundant? ascii() is already repr()-like. ChrisA ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] .clinic.c vs .c.clinic

2014-01-18 Thread Chris Angelico
On Sat, Jan 18, 2014 at 8:02 PM, Serhiy Storchaka wrote: > 2. I'm not use any IDE, but if you use, it can be important for you. If IDE > shows sources tree, unlikely you want to see generated *.clinic.c files in > them. This will increase the list of sources almost twice. A point for the contrary

Re: [Python-Dev] PEP 461 updates

2014-01-21 Thread Chris Barker
t; > thing. > that seems to work at the moment, actually, if done with care. That's just getting silly IMO. If the file uses mixed encodings then I > don't consider it a valid "text file" and see no reason for loadtxt to > support reading it. agreed -- that&#x

Re: [Python-Dev] Enable Hostname and Certificate Chain Validation

2014-01-22 Thread Chris Angelico
On Wed, Jan 22, 2014 at 11:15 PM, Donald Stufft wrote: > Do you really think those people would be making the same complaints > if they could restore the previous behavior with a simple boolean flag > delivered either via environment variable or in their own code? You assume that it's easy to twe

Re: [Python-Dev] Enable Hostname and Certificate Chain Validation

2014-01-22 Thread Chris Angelico
On Thu, Jan 23, 2014 at 1:08 AM, Jesse Noller wrote: >> Now, maybe it wouldn't be a problem if the fix is an environment >> variable, but imagine a thousand-computer deployment and you have to >> tweak the environment on all of them. Feel like doing that just >> because the newest Python needs it?

Re: [Python-Dev] str.rreplace

2014-01-24 Thread Chris Angelico
On Sat, Jan 25, 2014 at 3:38 AM, Antoine Pitrou wrote: > On Fri, 24 Jan 2014 18:32:17 +0200 > Ram Rachum wrote: >> Question: Why is there no str.rreplace in Python? > > What would it do? > (also, I think such questions are better asked on python-ideas) Or python-list. Chances are there's a way t

Re: [Python-Dev] str.rreplace

2014-01-24 Thread Chris Angelico
On Sat, Jan 25, 2014 at 4:19 AM, Ram Rachum wrote: > I now looked at the 17 most recent python-list threads. Out of them: > > - 58% are about third-party packages. > - 17% are off-topic (not even programming related) > - 11% are 2-vs-3 discussions > - 5% are job offers. > - 5% (which is just

Re: [Python-Dev] Quick poll: should help() show bound arguments?

2014-01-25 Thread Chris Angelico
On Sat, Jan 25, 2014 at 3:07 PM, Larry Hastings wrote: > What should it be? > > A) pydoc and help() should not show bound parameters in the signature, like > inspect.signature. > B) pydoc and help() should show bound parameters in the signature, like > inspect.getfullargspec. Vote for A. As far a

Re: [Python-Dev] PyPI offline, status is ok

2014-02-10 Thread Chris Angelico
On Mon, Feb 10, 2014 at 5:23 PM, anatoly techtonik wrote: > http://status.python.org/ shows all green > > https://pypi.python.org/pypi/gazest shows > > Error 503 backend read error > > backend read error > > Guru Meditation: > > XID: 2792709923 Working for me. But then, your email only just came

[Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Withers
else: return self_value < other_value return False Am I missing something? How can I get this method down to a sane size? cheers, Chris -- Simplistix - Content Management, Batch Processing & Python Consulting - http://www.simplistix.co.uk __

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Angelico
On Fri, Feb 14, 2014 at 7:04 PM, Chris Withers wrote: > > To implement __lt__ in Python 2, I could do: > > def __lt__(self, other): > if not isinstance(other, Range): > return True > return ((self._lower, self._upper, self._bounds) < >

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Angelico
On Fri, Feb 14, 2014 at 9:20 PM, Antoine Pitrou wrote: > Hmm, it seems you're right, but I'm quite sure some DBMSes have a > consistent way of ordering NULLs when using ORDER BY on a nullable > column. Yes, and I believe it's part of the SQL-92 spec. Certainly here's PostgreSQL's take on the matt

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Angelico
On Fri, Feb 14, 2014 at 9:42 PM, Nick Coghlan wrote: > IIRC, MySQL and PostgreSQL sort them in the opposite order from each > other Ouch! You're right: http://dev.mysql.com/doc/refman/5.7/en/working-with-null.html """When doing an ORDER BY, NULL values are presented first if you do ORDER BY ...

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Barker
orever, though what I really want is hardware support) But do you do that with a generic type or a special one for each type? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Barker
On Fri, Feb 14, 2014 at 1:29 AM, Nick Coghlan wrote: > On 14 February 2014 18:04, Chris Withers wrote: > > > > Am I missing something? How can I get this method down to a sane size? > > The easiest way is usually to normalise the attributes to a sensible > numeric valu

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-14 Thread Chris Angelico
On Sat, Feb 15, 2014 at 4:14 AM, Chris Barker wrote: > (though it could get a bit tricky -- what would AlwaysGreater > float('inf") > evaluate to? > It'd be true. AlwaysGreater is greater than infinity. It is greater than float("nan"). It is greater than the

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-17 Thread Chris Angelico
On Tue, Feb 18, 2014 at 1:30 AM, M.-A. Lemburg wrote: >> >> Also think of the implications of changing None at this point. It would >> allow us to write programs that work Python >= 3.5 and Python <= 2.7, but >> fail mysteriously in all other versions in between. What a mess that would >> be...

Re: [Python-Dev] python 3 niggle: None < 1 raises TypeError

2014-02-18 Thread Chris Angelico
On Wed, Feb 19, 2014 at 3:10 AM, Mark Lawrence wrote: > Sorry if this has already been suggested, but why not introduce a new > singleton to make the database people happier if not happy? To avoid > confusion call it dbnull? A reasonable compromise or complete cobblers? :) That would be a major

[Python-Dev] PEPs don't redirect on python.org

2014-02-19 Thread Chris Angelico
Apologies if this is misdirected! I notice the switch to the new python.org web site has happened; but now PEPs are simply 404: http://www.python.org/dev/peps/pep-0008/ However, trimming the URL offers a redirect: http://www.python.org/dev/peps/ -> http://legacy.python.org/dev/peps/ from whi

Re: [Python-Dev] PEPs don't redirect on python.org

2014-02-19 Thread Chris Angelico
On Thu, Feb 20, 2014 at 10:25 AM, Chris Angelico wrote: > I notice the switch to the new python.org web site has happened; but > now PEPs are simply 404: > > http://www.python.org/dev/peps/pep-0008/ > > However, trimming the URL offers a redirect: > > http:/

[Python-Dev] PEP 463: Exception-catching expressions

2014-02-20 Thread Chris Angelico
PEP: 463 Title: Exception-catching expressions Version: $Revision$ Last-Modified: $Date$ Author: Chris Angelico Status: Draft Type: Standards Track Content-Type: text/x-rst Created: 15-Feb-2014 Python-Version: 3.5 Post-History: 16-Feb-2014, 21-Feb-2014 Abstract Just as PEP 308

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-20 Thread Chris Angelico
On Fri, Feb 21, 2014 at 3:54 PM, Ethan Furman wrote: > (I'll vote on the syntax when the bikeshedding begins ;). Go get the keys to the time machine! Bikeshedding begins a week ago. ChrisA ___ Python-Dev mailing list [email protected] https://mail.

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Fri, Feb 21, 2014 at 10:35 PM, Nick Coghlan wrote: > On 21 February 2014 13:15, Chris Angelico wrote: >> PEP: 463 >> Title: Exception-catching expressions > Great work on this Chris - this is one of the best researched and > justified Python syntax proposals I've

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
xpression. >> >> Great work on this Chris - this is one of the best researched and >> justified Python syntax proposals I've seen :) > > Agreed - given the number of differing opinions on python-ideas, it's > particularly impressive how well the debate was conducte

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 12:53 AM, Nick Coghlan wrote: > On 21 February 2014 22:42, Chris Angelico wrote: >> People can already write: >> >> if (x if y else z): >> >> without the parens, and it works. Readability suffers when the same >> keyword is used twic

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:59 AM, Chris Angelico wrote: > I've spent the better part of the last hour debating this in my head. > It's basically a question of simplicity versus future flexibility: > either keep the syntax clean and deny the multiple-except-clause > option,

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:50 AM, Antoine Pitrou wrote: > On Sat, 22 Feb 2014 00:28:01 +1000 > Nick Coghlan wrote: >> >> Neither of these objections addresses the problems with the status quo, >> though: >> >> - the status quo encourages overbroad exception handling (as >> illustrated by examples

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:03 AM, Eli Bendersky wrote: > Chris, while I also commend you for the comprehensive PEP, I'm -1 on the > proposal, for two main reasons: > > 1. Many proposals suggest new syntax to gain some succinctness. Each has to > be judged for its own merits, a

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:22 AM, Rob Cliffe wrote: > Small point: in one of your examples you give a plug for the PEP "note the > DRY improvement". > I would suggest that similarly > perhaps in your Lib/tarfile.py:2198 example you point out the increase > in readability due to the 2 lines lini

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:34 AM, Brett Cannon wrote: > While I like the general concept, I agree that it looks too much like a > crunched statement; the use of the colon is a non-starter for me. I'm sure > I'm not the only one whose brain has been trained to view a colon in Python > to mean "state

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 2:19 AM, Brett Cannon wrote: > I understand you are arguing that a try expression will lead to people just > doing `something() except Exception: None` or whatever and that people will > simply get lazy and not think about what they are doing with their > exceptions. Unfort

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 3:46 AM, Eric Snow wrote: > Be sure to capture in the PEP (within reason) a summary of concerns > and rebuttals/acquiescence. Eli's, Brett's, and Antoine's concerns > likely reflect what others are thinking as well. The PEP and its > result will be better for recording su

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 4:32 AM, Antoine Pitrou wrote: >> value = (expr except Exception then default) > > +0.5 > But I'm aware it requires reserving "then" as a keyword, which might > need a prior SyntaxWarning. There are no instances of "then" used as a name in the Python stdlib, I already chec

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
b/tarfile.py:2198: >> try: >> g = grp.getgrnam(tarinfo.gname)[2] >> except KeyError: >> g = tarinfo.gid >> try: >> u = pwd.getpwnam(tarinfo.uname)[2] >> exce

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 9:06 AM, Greg Ewing wrote: > Nick Coghlan wrote: >> >> On 21 February 2014 13:15, Chris Angelico wrote: >> >>> Generator expressions require parentheses, unless they would be >>> strictly redundant. Ambiguities with except expres

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 10:29 AM, Greg Ewing wrote: > Antoine Pitrou wrote: > >>>lst = [1, 2] >>>value = lst[2] except IndexError: "No value" >> >> >> the gain in concision is counterbalanced by a loss in >> readability, > > > This version might be more readable: > >value = lst[2] exce

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 12:10 PM, Glenn Linderman wrote: > Here's a challenge: There has been a big thread about None versus (SQL) > Null. Show how an except: expression can help the DB API more easily convert > from using None to using a new Null singleton, and you'll have a winner :) Heh! I'm n

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 12:55 PM, Greg Ewing wrote: > Steven D'Aprano wrote: > >> result = computation( >> int(arg) except ValueError: abort("Invalid int") >> ) >> >> Actually, not quite so nice as I first thought, since you're relying on >> the side-effects o

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 1:07 PM, Victor Stinner wrote: > At the first read, I'm unable to understand this long expression. At > the second read, I'm still unable to see which instruction will be > executed first: lvl1[key] or lvl2[key]? > > The advantage of the current syntax is that the control f

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 3:04 PM, Chris Angelico wrote: > On Sat, Feb 22, 2014 at 1:07 PM, Victor Stinner > wrote: >> At the first read, I'm unable to understand this long expression. At >> the second read, I'm still unable to see which instruction will be >> exe

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-21 Thread Chris Angelico
On Sat, Feb 22, 2014 at 4:01 PM, Steven D'Aprano wrote: > (Chris, I think that ought to go in the motivation section of the PEP.) Added to my draft, and here's the peps diff: diff -r c52a2ae3d98e pep-0463.txt --- a/pep-0463.txt Fri Feb 21 23:27:51 2014 -0500 +++ b/pep-0463.txt Sat

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 8:20 PM, Antoine Pitrou wrote: > On Sat, 22 Feb 2014 16:12:27 +0900 > "Stephen J. Turnbull" wrote: >> >> Note in support: I originally thought that "get" methods would be more >> efficient, but since Nick pointed out that "haveattr" is implemented >> by catching the except

Re: [Python-Dev] Tangent on class level scoping rules (was Re: PEP 463: Exception-catching expressions)

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 10:57 AM, Greg Ewing wrote: > Nick Coghlan wrote: >> >> As Chris later noted, you likely *could* still implement expression >> local name binding for an except expression without a full closure, it >> would just be rather difficult. > > &

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 8:58 PM, Antoine Pitrou wrote: > On Sat, 22 Feb 2014 20:29:27 +1100 > Chris Angelico wrote: >> >> Which means that, fundamentally, EAFP is the way to do it. So if PEP >> 463 expressions had existed from the beginning, hasattr() probably >&

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 9:17 PM, Antoine Pitrou wrote: > On Sat, 22 Feb 2014 21:09:07 +1100 > Chris Angelico wrote: >> On Sat, Feb 22, 2014 at 8:58 PM, Antoine Pitrou wrote: >> > On Sat, 22 Feb 2014 20:29:27 +1100 >> > Chris Angelico wrote: >> >> >

Re: [Python-Dev] Tangent on class level scoping rules (was Re: PEP 463: Exception-catching expressions)

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 10:01 PM, Greg Ewing wrote: > Chris Angelico wrote: >> >> On Sat, Feb 22, 2014 at 10:57 AM, Greg Ewing >> wrote: >> >>> I'm still not convinced it would be all *that* difficult. >>> Seems to me it would be semantically

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 10:27 PM, Antoine Pitrou wrote: > Yeah, none of these examples makes a convincing case that hasattr() is > useless, IMO. I'm not trying to make the case that it's useless. I'm trying to show that, if it didn't exist, all of these would be written some other way, and the ca

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sat, Feb 22, 2014 at 11:14 PM, Stephen J. Turnbull wrote: > Antoine Pitrou writes: > > On Sat, 22 Feb 2014 22:13:58 +1100 > > Chris Angelico wrote: > > > > hasattr(x,"y") <-> (x.y or True except AttributeError: False) > > > But it

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-22 Thread Chris Angelico
On Sun, Feb 23, 2014 at 11:00 AM, Thomas Wouters wrote: > On Sat, Feb 22, 2014 at 2:08 AM, Thomas Wouters wrote: >> >> (FWIW, I have a working patch without tests that allows all of these, I'll >> upload it tonight so people can play with it. Oh, and FWIW, currently I'm +0 >> on the idea, -0 on t

Re: [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2

2014-02-22 Thread Chris Angelico
On Sun, Feb 23, 2014 at 12:56 PM, Ethan Furman wrote: > Open Questions > == > > It has been suggested to use ``%b`` for bytes as well as ``%s``. > > - Pro: clearly says 'this is bytes'; should be used for new code. > > - Con: does not exist in Python 2.x, so we would have two ways

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-23 Thread Chris Angelico
On Mon, Feb 24, 2014 at 6:26 AM, Thomas Wouters wrote: >> I see a risk of interfering with in-place assignment operators, e.g. >> >> x /= y except ZeroDivisionError: 1 >> >> might not do what one could expect, because (as I assume) it would behave >> differently from >> >> x = x / y except

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-23 Thread Chris Angelico
On Mon, Feb 24, 2014 at 7:51 AM, Ethan Furman wrote: >> Yes. Augmented assignment is still assignment, so a statement. The only >> way to parse that is as >> >> x /= (y except ZeroDivisionError: 1) > > > Well, that is certainly not what I would have expected. I can see that you'd want to have tha

Re: [Python-Dev] PEP 463: Exception-catching expressions

2014-02-24 Thread Chris Angelico
On Tue, Feb 25, 2014 at 11:27 AM, Jim J. Jewett wrote: > This also makes me wonder whether the cost of a subscope > (for exception capture) could be limited to when an > exception actually occurs, and whether that might lower > the cost enough to make the it a good tradeoff. > > def myfunc1(a,

Re: [Python-Dev] Python Remote Code Execution in socket.recvfrom_into()

2014-02-25 Thread Chris Angelico
On Tue, Feb 25, 2014 at 11:59 PM, Maciej Fijalkowski wrote: >> Last issues: >> - hash DoS > > is this fixed? Yes, hash randomization was added as an option in 2.7.3 or 2.7.4 or thereabouts, and is on by default in 3.3+. You do have to set an environment variable for 2.7 (and I think 2.6 got that

Re: [Python-Dev] Python Remote Code Execution in socket.recvfrom_into()

2014-02-25 Thread Chris Angelico
On Wed, Feb 26, 2014 at 12:07 AM, Maciej Fijalkowski wrote: > No, the hash randomization is broken, it does not provide enough > randomness (without changing the hash function which only happened in > 3.4+) Hmm, I don't remember reading about that - got a link to more info? Or was that report kep

<    2   3   4   5   6   7   8   9   10   11   >