Re: [Python-Dev] requirements for moving __import__ over to importlib?

2012-02-10 Thread Chris Angelico
annoyingly when a single process changes a file, then attempts to import it. If you open a file, write to it, explicitly close it, and then load it, you would expect to read back what you wrote, not the version that was there previously. Chris Angelico

Re: [Python-Dev] cpython (3.2): Issue #14123: Explicitly mention that old style % string formatting has caveats

2012-02-26 Thread Chris Angelico
and mythical varargs token), but in their basics they will be similar. The name is worth keeping. Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

Re: [Python-Dev] Add a frozendict builtin type

2012-02-29 Thread Chris Angelico
and partly drive our code). But features enabling that needn't be core; I wouldn't object to having to get some third-party add-ons to make it all work. Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman

Re: [Python-Dev] Playing with a new theme for the docs

2012-03-22 Thread Chris Angelico
On Fri, Mar 23, 2012 at 6:50 AM, Glenn Linderman v+pyt...@g.nevcal.com wrote: 3. Make the sidebar separately scrollable, so that it stays visible when scrolling down in the text.  This would make it much easier to jump from section to section, if the TOC didn't get lost in the process. -1. The

Re: [Python-Dev] .{git,bzr}ignore in cpython HG repo

2012-04-02 Thread Chris Angelico
that generates .gitignore and .bzrignore from .hgignore? That ought to solve the problem - take the former two out of the repository, and everyone who wants to use git or bzr can simply generate them on requirement. Chris Angelico ___ Python-Dev mailing list

Re: [Python-Dev] an alternative to embedding policy in PEP 418

2012-04-04 Thread Chris Angelico
be the same as =True, and =False wouldn't be. And get_clock(monotonic=No, you idiot, I want one that ISN'T) would... be stupid. But it'd still function :) Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo

Re: [Python-Dev] PEP 418 glossary

2012-04-11 Thread Chris Angelico
On Wed, Apr 11, 2012 at 4:49 PM, Jim Jewett jimjjew...@gmail.com wrote: Clock:    An instrument for measuring time.  Different clocks have different characteristics; for example, a clock with nanonsecond precision Small typo. Otherwise, excellent reference document - thank you! Well worth

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-15 Thread Chris Angelico
be used. Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 418: Add monotonic time, performance counter and process time functions

2012-04-17 Thread Chris Angelico
On Tue, Apr 17, 2012 at 2:48 PM, Cameron Simpson c...@zip.com.au wrote: On 16Apr2012 01:25, Victor Stinner victor.stin...@gmail.com wrote: | I suppose that most people don't care that resolution and | precision are different things. If we're using the same definitions we discussed offline,

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
On Thu, Apr 19, 2012 at 12:47 AM, Guido van Rossum gu...@python.org wrote: I don't believe PEP 8 requires whitespace around all binary operators. Where do you read that? Quoting from http://www.python.org/dev/peps/pep-0008/#other-recommendations (with elision): Use spaces around arithmetic

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-18 Thread Chris Angelico
. Following or preceding? Either works, but there's a slight shift of meaning depending on which punctuation gets the upgrade. What was the original intent of the paragraph? Chris Angelico ___ Python-Dev mailing list Python-Dev@python.org http

Re: [Python-Dev] Suggested addition to PEP 8 for context managers

2012-04-19 Thread Chris Angelico
On Fri, Apr 20, 2012 at 1:00 AM, Éric Araujo mer...@netwok.org wrote: Hi, +- If operators with different priorities are used, consider adding +  whitespace around the operators with the lowest priority(ies). This +  is very much to taste; however, never use more than one space, and +  always

Re: [Python-Dev] netiquette on py-dev

2012-04-24 Thread Chris Angelico
On Wed, Apr 25, 2012 at 1:44 PM, Stephen J. Turnbull step...@xemacs.org wrote: I don't know of any webmail implementations that provide reply-to-list, so a lot of us end up using reply-to-all.  Cleaning up the headers requires at least deleting the To (which is where the author ends up), and

Re: [Python-Dev] CRLF line endings

2012-05-03 Thread Chris Angelico
on Windows and run into one, I open it in Wordpad (or, if I have one, a dedicated programming editor like SciTE or the Open Watcom editor). AFAIK only Notepad (of standard Windows utilities) has trouble. Not sure if that makes a difference or not. Chris Angelico

Re: [Python-Dev] CRLF line endings

2012-05-03 Thread Chris Angelico
On Fri, May 4, 2012 at 1:28 AM, Vinay Sajip vinay_sa...@yahoo.co.uk wrote: It's only really an issue for new / inexperienced users, I agree. Since these files are installed only on Windows systems, there's no reason for them not to have the native line endings. Then sure, doesn't make a lot of

Re: [Python-Dev] Debian wheezy, amd64: make not finding files for bz2 and other packages

2012-05-04 Thread Chris Angelico
On Sat, May 5, 2012 at 4:07 AM, Edward C. Jones edcjo...@comcast.net wrote: /usr/include/bzlib.h /usr/lib/x86_64-linux-gnu/libbz2.a /usr/lib/x86_64-linux-gnu/libbz2.so /lib/x86_64-linux-gnu/libbz2.so.1 /lib/x86_64-linux-gnu/libbz2.so.1.0 /lib/x86_64-linux-gnu/libbz2.so.1.0.4 I have an

Re: [Python-Dev] PEP 405 (pyvenv) and system Python upgrades

2012-05-05 Thread Chris Angelico
On Sat, May 5, 2012 at 6:49 AM, Carl Meyer c...@oddbird.net wrote: 2) In addition to the above, introduce a versioning marker in the standard library (is there one already?) and have some code somewhere (insert hand-waving here) check sys.version_info against the stdlib version, and fail fast

Re: [Python-Dev] docs.python.org pointing to Python 3 by default?

2012-05-19 Thread Chris Angelico
On Sun, May 20, 2012 at 4:43 AM, Glyph gl...@twistedmatrix.com wrote: Right now, e.g. http://docs.python.org/tutorial/index.html directly renders a page.  I suggest that this be changed to a redirect to http://docs.python.org/release/2.7/tutorial/index.html.  The fact that people can

Re: [Python-Dev] Restricted API versioning

2012-06-23 Thread Chris Angelico
On Sun, Jun 24, 2012 at 9:40 AM, Christian Heimes li...@cheimes.de wrote: +1 for the general idea and for using Py_LIMITED_API. I still like my idea of a simple macro based on Include/patchlevel.h, for example: #define Py_API_VERSION(major, minor, micro) \   (((major) 24) | ((minor) 16) |

Re: [Python-Dev] Restricted API versioning

2012-06-24 Thread Chris Angelico
On Sun, Jun 24, 2012 at 5:08 PM, Nick Coghlan ncogh...@gmail.com wrote: On Sun, Jun 24, 2012 at 5:00 PM, Martin v. Löwis mar...@v.loewis.de wrote: This strikes me as in opposition to the Python-level policy of duck typing. Would it be more appropriate to, instead of asking if it's Python

Re: [Python-Dev] stat module in C -- what to do with stat.py?

2013-06-21 Thread Chris Angelico
On Fri, Jun 21, 2013 at 11:06 AM, Nick Coghlan ncogh...@gmail.com wrote: On 21 June 2013 01:04, Thomas Wouters tho...@python.org wrote: If the .py file is going to be wrong or incomplete, why would we want to keep it -- or use it as fallback -- at all? If we're dead set on having a .py file

Re: [Python-Dev] Python 3 as a Default in Linux Distros

2013-07-24 Thread Chris Angelico
On Wed, Jul 24, 2013 at 7:12 PM, Bohuslav Kabrda bkab...@redhat.com wrote: - What should user get after using yum install python? There are basically few ways of coping with this: 1) Just keep doing what we do, eventually far in the future drop python package and never provide it again (= go

Re: [Python-Dev] Python 3 as a Default in Linux Distros

2013-07-24 Thread Chris Angelico
On Thu, Jul 25, 2013 at 2:21 AM, Laurent Gautier lgaut...@gmail.com wrote: - errors that are typical of Python 2 script running with Python 3-specific are probably limited (e.g., use of unicode, use of xrange, etc...) The most common, in interactive scripts at least, is likely to be: print

Re: [Python-Dev] Official github mirror for CPython?

2013-07-25 Thread Chris Angelico
On Fri, Jul 26, 2013 at 12:29 AM, Eli Bendersky eli...@gmail.com wrote: Hi all, I've been looking for a Github mirror for Python, and found two: * https://github.com/python-git/python has a lot of forks/watches/starts but seems to be very out of date (last updated 4 years ago) *

Re: [Python-Dev] Lambda [was Re: PEP 8 modernisation]

2013-08-01 Thread Chris Angelico
On Thu, Aug 1, 2013 at 5:58 PM, Alexander Shorin kxe...@gmail.com wrote: fun = lambda i: i[1] for key, items in groupby(sorted(items, key=fun), key=fun): print(key, ':', list(items)) I'd do a direct translation to def here: def fun(i): return i[1] for key, items in groupby(sorted(items,

Re: [Python-Dev] Deprecating the formatter module

2013-08-14 Thread Chris Angelico
On Wed, Aug 14, 2013 at 6:42 PM, Nick Coghlan ncogh...@gmail.com wrote: That would be PEP 4 :) What's the normal way to update a PEP? ... proposals for deprecating modules MUST be made by providing a change to the text of this PEP, which SHOULD be a patch posted to SourceForge... Would

Re: [Python-Dev] When to remove deprecated stuff

2013-08-22 Thread Chris Angelico
On Thu, Aug 22, 2013 at 11:45 PM, Michael Foord fuzzy...@voidspace.org.uk wrote: On 22 Aug 2013, at 14:00, Petri Lehtinen pe...@digip.org wrote: Django's deprecation policy works like this: They deprecate something in version A.B. It still works normally in A.B+1, generates a (silenced)

Re: [Python-Dev] summing integer and class

2013-10-03 Thread Chris Angelico
On Thu, Oct 3, 2013 at 11:09 PM, Игорь Васильев vasilyev_i...@inbox.ru wrote: When we adding class to integer we have both slotv and slotw. x = slotv(v, w); - returns Py_NotImplemented. But in this case we should execute x = slotw(v, w); and function should be completed in the same way as when

Re: [Python-Dev] Which direction is UnTransform? / Unicode is different

2013-11-20 Thread Chris Angelico
On Wed, Nov 20, 2013 at 11:03 PM, Steven D'Aprano st...@pearwood.info wrote: I *will* get confused over which direction is encoding and which is decoding. (Removing .decode() from the (unicode) str type in 3 does help a lot, if I have a Python 3 interpreter running to check against.) It took

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 ncogh...@gmail.com 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

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 techto...@gmail.com 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

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 mar...@v.loewis.de wrote: Am 05.12.13 16:21, schrieb Vajrasky Kok: On Thu, Dec 5, 2013 at 11:06 PM, Martin v. Löwis mar...@v.loewis.de wrote: Can you please phrase your question more explicit? What is it that you want to be done before writing

[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

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 storch...@gmail.com 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

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 dan...@pocock.com.au 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

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 ros...@gmail.com 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 am

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 ros...@gmail.com wrote: On Sun, Dec 8, 2013 at 12:35 AM, Chris Angelico ros...@gmail.com 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

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 christ...@python.org 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.

[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 solip...@pitrou.net wrote: On Tue, 31 Dec 2013 11:24:26 +1100 Chris Angelico ros...@gmail.com 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.3

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 zachary.ware+py...@gmail.com 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

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 mar...@v.loewis.de 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

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 drsali...@gmail.com 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

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 h...@gfierro.com 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

[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.

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 christ...@python.org 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 expecting ECONNREFUSED. Possibly my firewall's

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 christ...@python.org 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

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 solip...@pitrou.net 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

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 victor.stin...@gmail.com 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

Re: [Python-Dev] Python3 complexity

2014-01-08 Thread Chris Angelico
On Thu, Jan 9, 2014 at 11:21 AM, MRAB pyt...@mrabarnett.plus.com 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) #

Re: [Python-Dev] Python3 complexity

2014-01-09 Thread Chris Angelico
On Thu, Jan 9, 2014 at 5:50 PM, Lennart Regebro rege...@gmail.com 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

Re: [Python-Dev] Python3 complexity

2014-01-09 Thread Chris Angelico
On Fri, Jan 10, 2014 at 11:53 AM, anatoly techtonik techto...@gmail.com 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

Re: [Python-Dev] Python3 complexity

2014-01-09 Thread Chris Angelico
On Fri, Jan 10, 2014 at 1:39 PM, Steven D'Aprano st...@pearwood.info 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 techto...@gmail.com wrote: 2. introduce autodetect mode to open functions 1. read

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 juraj.su...@gmail.com wrote: On Sun, Jan 12, 2014 at 6:22 PM, Steven D'Aprano st...@pearwood.info 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

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 jimjjew...@gmail.com 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

[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 problem,

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 zachary.ware+py...@gmail.com wrote: On Mon, Jan 13, 2014 at 6:48 PM, Chris Angelico ros...@gmail.com 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

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 tjre...@udel.edu 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 says that it is a bug for posix.getgroups

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 pyt...@mrabarnett.plus.com 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!

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 mar...@v.loewis.de 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

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 e...@trueblade.com 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

Re: [Python-Dev] PEP 461 Final?

2014-01-17 Thread Chris Angelico
On Sat, Jan 18, 2014 at 12:51 PM, Ethan Furman et...@stoneleaf.us 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

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 storch...@gmail.com 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

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 don...@stufft.io 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

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 jnol...@gmail.com 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

Re: [Python-Dev] str.rreplace

2014-01-24 Thread Chris Angelico
On Sat, Jan 25, 2014 at 3:38 AM, Antoine Pitrou solip...@pitrou.net wrote: On Fri, 24 Jan 2014 18:32:17 +0200 Ram Rachum r...@rachum.com 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.

Re: [Python-Dev] str.rreplace

2014-01-24 Thread Chris Angelico
On Sat, Jan 25, 2014 at 4:19 AM, Ram Rachum r...@rachum.com 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

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 la...@hastings.org 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

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 techto...@gmail.com 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

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 ch...@simplistix.co.uk 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 solip...@pitrou.net 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

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 ncogh...@gmail.com 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

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 chris.bar...@noaa.gov 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 entire concept of

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 m...@egenix.com 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

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 breamore...@yahoo.co.uk 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? :)

[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

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 ros...@gmail.com 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://www.python.org/dev/peps

[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 ros...@gmail.com 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

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 et...@stoneleaf.us 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

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 ncogh...@gmail.com wrote: On 21 February 2014 13:15, Chris Angelico ros...@gmail.com 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
On Fri, Feb 21, 2014 at 11:37 PM, Paul Moore p.f.mo...@gmail.com wrote: On 21 February 2014 11:35, Nick Coghlan ncogh...@gmail.com wrote: Just as PEP 308 introduced a means of value-based conditions in an expression, this system allows exception-based conditions to be used as part of an

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 ncogh...@gmail.com wrote: On 21 February 2014 22:42, Chris Angelico ros...@gmail.com 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 twice (here if rather

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 ros...@gmail.com 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, or mandate

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 solip...@pitrou.net wrote: On Sat, 22 Feb 2014 00:28:01 +1000 Nick Coghlan ncogh...@gmail.com wrote: Neither of these objections addresses the problems with the status quo, though: - the status quo encourages overbroad exception handling (as

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 eli...@gmail.com 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, and in this

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 rob.cli...@btinternet.com 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

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 br...@python.org 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

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 br...@python.org 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

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 ericsnowcurren...@gmail.com 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

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 solip...@pitrou.net 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

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

2014-02-21 Thread Chris Angelico
to bubble up. import pwd pwd.getpwnam(rosuav) pwd.struct_passwd(pw_name='rosuav', pw_passwd='x', pw_uid=1000, pw_gid=1000, pw_gecos='Chris Angelico,,,', pw_dir='/home/rosuav', pw_shell='/bin/bash') pwd.getpwnam(spam) Traceback (most recent call last): File stdin, line 1, in module KeyError

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 greg.ew...@canterbury.ac.nz wrote: Nick Coghlan wrote: On 21 February 2014 13:15, Chris Angelico ros...@gmail.com wrote: Generator expressions require parentheses, unless they would be strictly redundant. Ambiguities with except expressions could

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 greg.ew...@canterbury.ac.nz 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]

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 v+pyt...@g.nevcal.com 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

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 greg.ew...@canterbury.ac.nz 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

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 victor.stin...@gmail.com 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

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 ros...@gmail.com wrote: On Sat, Feb 22, 2014 at 1:07 PM, Victor Stinner victor.stin...@gmail.com 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

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 st...@pearwood.info 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

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 solip...@pitrou.net wrote: On Sat, 22 Feb 2014 16:12:27 +0900 Stephen J. Turnbull step...@xemacs.org wrote: Note in support: I originally thought that get methods would be more efficient, but since Nick pointed out that haveattr is implemented

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 greg.ew...@canterbury.ac.nz 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. I'm still not

  1   2   3   4   5   6   7   >