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

2012-04-17 Thread Nam Nguyen
On Mon, Apr 16, 2012 at 8:30 AM, Barry Warsaw ba...@python.org wrote: On Apr 15, 2012, at 01:13 PM, Raymond Hettinger wrote: We should publish some advice on creating content managers. I agree, I'm just not sure PEP 8 is the right place for it. PEP 8 seems like it is structured more as

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

2012-04-17 Thread Matej Cepl
On 16.4.2012 18:10, Nam Nguyen wrote: a_list[pos + 1 : -1] or other way around a_list[pos+1:-1] ? Matěj ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe:

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

2012-04-17 Thread Paul Moore
On 16 April 2012 17:10, Nam Nguyen bits...@gmail.com wrote: PEP 8 suggests no extra spaces after and before square brackets, and colons. So code like this is appropriate: a_list[1:3] But I find it less readable in the case of: a_list[pos + 1:-1] The colon is seemingly lost in the right.

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

2012-04-17 Thread Sümer Cip
On Sun, Apr 15, 2012 at 6:18 PM, Victor Stinner victor.stin...@gmail.comwrote: Here is a simplified version of the first draft of the PEP 418. The full version can be read online. http://www.python.org/dev/peps/pep-0418/ FYI there is no time.thread_time() function. It would only be

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread Antoine Pitrou
On Mon, 16 Apr 2012 20:41:56 -0400 Brett Cannon br...@python.org wrote: On Mon, Apr 16, 2012 at 20:27, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012 01:11:14 +0200 Georg Brandl g.bra...@gmx.net wrote: No, it's not just an existing Python, it is (at least currently) the

Re: [Python-Dev] cpython: Issue #13959: Re-implement imp.load_source() in imp.py.

2012-04-17 Thread Antoine Pitrou
On Tue, 17 Apr 2012 04:11:31 +0200 brett.cannon python-check...@python.org wrote: http://hg.python.org/cpython/rev/3b5b4b4bb43c changeset: 76371:3b5b4b4bb43c user:Brett Cannon br...@python.org date:Mon Apr 16 22:11:25 2012 -0400 summary: Issue #13959: Re-implement

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread Eric V. Smith
On 4/17/2012 5:52 AM, Antoine Pitrou wrote: On Mon, 16 Apr 2012 20:41:56 -0400 Brett Cannon br...@python.org wrote: On Mon, Apr 16, 2012 at 20:27, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012 01:11:14 +0200 Georg Brandl g.bra...@gmx.net wrote: No, it's not just an existing

[Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Kristján Valur Jónsson
Hello there. For those familiar with the intricacies of the gcmodule.c, I would like to draw your attention to http://bugs.python.org/issue9141. I would like to consult with you to find out more about finalizers/gc in order to improve the in-file documentation. Traditionally, it has not been

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread R. David Murray
On Tue, 17 Apr 2012 01:11:14 +0200, Georg Brandl g.bra...@gmx.net wrote: On 16.04.2012 18:15, R. David Murray wrote: I don't see how depending on Cython is better than depending on having an existing Python. No, it's not just an existing Python, it is (at least currently) the same version

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

2012-04-17 Thread R. David Murray
On Tue, 17 Apr 2012 08:53:43 +0200, Matej Cepl mc...@redhat.com wrote: On 16.4.2012 18:10, Nam Nguyen wrote: a_list[pos + 1 : -1] or other way around a_list[pos+1:-1] That's what I always use. No spaces inside the brackets for me :) If the expression gets unreadable that way, factor

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

2012-04-17 Thread R. David Murray
On Tue, 17 Apr 2012 14:48:22 +1000, 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

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-17 Thread Guido van Rossum
On Tue, Apr 17, 2012 at 12:14 AM, Paul Moore p.f.mo...@gmail.com wrote: On 16 April 2012 17:10, Nam Nguyen bits...@gmail.com wrote: PEP 8 suggests no extra spaces after and before square brackets, and colons. So code like this is appropriate: a_list[1:3] But I find it less readable in the

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread martin
What I want to know is, why is this limitation in place? Here are two possibilities: 1) The order of calling finalizers in a cycle is undefined so it is not a solvable problem. But this would allow a single object, with only internal cycles to be collected. Currently this is not

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

2012-04-17 Thread Barry Warsaw
On Apr 17, 2012, at 08:25 AM, R. David Murray wrote: On Tue, 17 Apr 2012 08:53:43 +0200, Matej Cepl mc...@redhat.com wrote: On 16.4.2012 18:10, Nam Nguyen wrote: a_list[pos + 1 : -1] or other way around a_list[pos+1:-1] That's what I always use. No spaces inside the brackets for me :)

Re: [Python-Dev] cpython: Issue #13959: Re-implement imp.load_source() in imp.py.

2012-04-17 Thread Brett Cannon
On Tue, Apr 17, 2012 at 05:53, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012 04:11:31 +0200 brett.cannon python-check...@python.org wrote: http://hg.python.org/cpython/rev/3b5b4b4bb43c changeset: 76371:3b5b4b4bb43c user:Brett Cannon br...@python.org date:

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread Brett Cannon
On Tue, Apr 17, 2012 at 06:43, Eric V. Smith e...@trueblade.com wrote: On 4/17/2012 5:52 AM, Antoine Pitrou wrote: On Mon, 16 Apr 2012 20:41:56 -0400 Brett Cannon br...@python.org wrote: On Mon, Apr 16, 2012 at 20:27, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012

Re: [Python-Dev] making the import machinery explicit

2012-04-17 Thread Brett Cannon
The only people to bring up worries about this thread were Eric and Nick and they both seem fine with making stuff explicit and changing the meaning of None in sys.path_importer_cache, so I have created http://bugs.python.org/issue14605 and will plan on implementing the ideas for it before Python

Re: [Python-Dev] Require loaders set __package__ and __loader__

2012-04-17 Thread Brett Cannon
Anyone other than Eric have something to say on this proposal? Obviously the discussion went tangential before I saw a clear consensus that what I was proposing was fine with people. On Sat, Apr 14, 2012 at 16:56, Brett Cannon br...@python.org wrote: An open issue in PEP 302 is whether to

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread Antoine Pitrou
On Tue, 17 Apr 2012 11:41:32 -0400 Brett Cannon br...@python.org wrote: Actually Cython would help with a subtle maintenance burden of maintaining *any* C code for import. Right now, Python/import.c:PyImport_ImportModuleLevelObject() is an accelerated C version of importlib.__import__()

Re: [Python-Dev] making the import machinery explicit

2012-04-17 Thread Philip Jenvey
On Apr 14, 2012, at 1:03 PM, Brett Cannon wrote: And lastly, sticking None in sys.path_importer_cache would no longer mean do the implicit thing and instead would mean the same as NullImporter does now (which also means import can put None into sys.path_importer_cache instead of

Re: [Python-Dev] making the import machinery explicit

2012-04-17 Thread Brett Cannon
On Tue, Apr 17, 2012 at 13:45, Philip Jenvey pjen...@underboss.org wrote: On Apr 14, 2012, at 1:03 PM, Brett Cannon wrote: And lastly, sticking None in sys.path_importer_cache would no longer mean do the implicit thing and instead would mean the same as NullImporter does now (which also

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Kristján Valur Jónsson
-Original Message- No, that's not the case at all. As Antoine explains in the issue, there are plenty of ways in which Python code can be run when breaking a cycle. Not only weakrefs, but also objects released as a consequence of tp_clear which weren't *in* the cycle (but hung

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Antoine Pitrou
On Tue, 17 Apr 2012 17:22:57 + Kristján Valur Jónsson krist...@ccpgames.com wrote: We are all consenting adults. Everything is allowed - you just have to live with the consequences. Well, we specifically decided that objects with __del__ methods that are part of a cycle cannot

Re: [Python-Dev] importlib is now bootstrapped (and what that means)

2012-04-17 Thread Brett Cannon
On Tue, Apr 17, 2012 at 13:39, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012 11:41:32 -0400 Brett Cannon br...@python.org wrote: Actually Cython would help with a subtle maintenance burden of maintaining *any* C code for import. Right now,

Re: [Python-Dev] issue 9141, finalizers and gc module

2012-04-17 Thread Maciej Fijalkowski
On Tue, Apr 17, 2012 at 8:30 PM, Antoine Pitrou solip...@pitrou.net wrote: On Tue, 17 Apr 2012 17:22:57 + Kristján Valur Jónsson krist...@ccpgames.com wrote: We are all consenting adults. Everything is allowed - you just have to live with the consequences. Well, we

Re: [Python-Dev] Require loaders set __package__ and __loader__

2012-04-17 Thread Andrew Svetlov
+1 for initial proposition. On Tue, Apr 17, 2012 at 6:59 PM, Brett Cannon br...@python.org wrote: Anyone other than Eric have something to say on this proposal? Obviously the discussion went tangential before I saw a clear consensus that what I was proposing was fine with people. On Sat,

Re: [Python-Dev] making the import machinery explicit

2012-04-17 Thread Terry Reedy
On 4/17/2012 2:01 PM, Brett Cannon wrote: Isn't it clearer to say ``sys.path_importer_cache[path] is None`` than ``isinstance(sys.path_importer_cache[path], imp.NullImporter)``? Yes. Great work. Thanks for helping with the Idle breakage. -- Terry Jan Reedy

Re: [Python-Dev] Require loaders set __package__ and __loader__

2012-04-17 Thread Nick Coghlan
+1 here. Previously, it wasn't a reasonable requirement, since CPython itself didn't comply with it. -- Sent from my phone, thus the relative brevity :) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev

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

2012-04-17 Thread Victor Stinner
I think what the user cares about is what is the smallest tick that this clock result will faithfully represent?.  If the number of bits returned is larger than the clock accuracy, you want the clock accuracy. If the number of bits returned is smaller than the clock accuracy, you want the

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

2012-04-17 Thread Cameron Simpson
On 18Apr2012 00:18, Chris Angelico ros...@gmail.com wrote: | 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

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

2012-04-17 Thread Cameron Simpson
On 17Apr2012 08:35, R. David Murray rdmur...@bitdance.com wrote: | On Tue, 17 Apr 2012 14:48:22 +1000, 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

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

2012-04-17 Thread Victor Stinner
Here is a simplified version of the first draft of the PEP 418. The full version can be read online. http://www.python.org/dev/peps/pep-0418/ The implementation of the PEP can be found in this issue: http://bugs.python.org/issue14428 The PEP is now fully ready: I just finished the

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

2012-04-17 Thread Guido van Rossum
I'll do it. Give me a few days (tomorrow is fully booked with horrible meetings). On Tue, Apr 17, 2012 at 5:06 PM, Victor Stinner victor.stin...@gmail.com wrote: Here is a simplified version of the first draft of the PEP 418. The full version can be read online.

Re: [Python-Dev] [Python-checkins] cpython (2.7): Clean-up the SQLite introduction.

2012-04-17 Thread Ezio Melotti
Hi, On Tue, Apr 17, 2012 at 8:48 PM, raymond.hettinger python-check...@python.org wrote: http://hg.python.org/cpython/rev/d229032dc213 changeset:   76387:d229032dc213 branch:      2.7 user:        Raymond Hettinger pyt...@rcn.com date:        Tue Apr 17 22:48:06 2012 -0400 summary: