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

2012-04-16 Thread Nam Nguyen
On Mon, Apr 16, 2012 at 8:30 AM, Barry Warsaw 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 mechanical gui

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

2012-04-16 Thread Stefan Behnel
Antoine Pitrou, 17.04.2012 02:27: > On Tue, 17 Apr 2012 01:11:14 +0200 > Georg Brandl wrote: >> No, it's not just an existing Python, it is (at least currently) the same >> version of Python being built. Therefore I wrote about the bootstrapping >> problems when bytecode changes. >> >> Depending o

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

2012-04-16 Thread Stefan Behnel
Amaury Forgeot d'Arc, 16.04.2012 22:43: > 2012/4/16 Stefan Behnel >>> On the down side, we would depend on Cython for evolving . >> >> Right, although not as a strict dependency. The code would still work just >> fine in plain Python. > > Not quite, we are talking of the imp module here... Hmm, r

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

2012-04-16 Thread Cameron Simpson
On 16Apr2012 01:25, Victor Stinner 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, where - resolution is the units the clock call (underneath) works in (for example, nanosecon

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

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 20:27, Antoine Pitrou wrote: > On Tue, 17 Apr 2012 01:11:14 +0200 > Georg Brandl wrote: > > > > No, it's not just an existing Python, it is (at least currently) the same > > version of Python being built. Therefore I wrote about the bootstrapping > > problems when byteco

[Python-Dev] Failed issue tracker submission

2012-04-16 Thread Python tracker
An unexpected error occurred during the processing of your message. The tracker administrator is being notified. Return-Path: X-Original-To: rep...@bugs.python.org Delivered-To: roundup+trac...@psf.upfronthosting.co.za Received: from mail.python.org (mail.python.org [82.94.164.166]) by ps

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

2012-04-16 Thread Antoine Pitrou
On Tue, 17 Apr 2012 01:11:14 +0200 Georg Brandl wrote: > > No, it's not just an existing Python, it is (at least currently) the same > version of Python being built. Therefore I wrote about the bootstrapping > problems when bytecode changes. > > Depending on Cython is better in that it breaks t

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

2012-04-16 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/ I wrote an implementation in pure Python using ctypes for Python < 3.3: https://bitbucket.org/haypo/misc/src/tip/python/pep418.py I tested it on Lin

Re: [Python-Dev] cpython: Add documentation for the new PyErr_SetFromImport* functions

2012-04-16 Thread Brian Curtin
On Mon, Apr 16, 2012 at 18:02, Georg Brandl wrote: > On 16.04.2012 22:14, brian.curtin wrote: >> >> http://hg.python.org/cpython/rev/5cc8b717b38c >> changeset:   76363:5cc8b717b38c >> user:        Brian Curtin >> date:        Mon Apr 16 15:14:36 2012 -0500 >> summary: >>   Add documentation for th

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

2012-04-16 Thread Georg Brandl
On 16.04.2012 18:15, R. David Murray wrote: On Mon, 16 Apr 2012 11:21:34 -0400, Brett Cannon wrote: On Mon, Apr 16, 2012 at 10:07, "Martin v. Löwis" wrote: > > We have other instances of this (e.g. the Objects/typeslots.inc file > > is generated and checked in), but in the case of imp

Re: [Python-Dev] cpython: Add documentation for the new PyErr_SetFromImport* functions

2012-04-16 Thread Georg Brandl
On 16.04.2012 22:14, brian.curtin wrote: http://hg.python.org/cpython/rev/5cc8b717b38c changeset: 76363:5cc8b717b38c user:Brian Curtin date:Mon Apr 16 15:14:36 2012 -0500 summary: Add documentation for the new PyErr_SetFromImport* functions files: Doc/c-api/exceptions.rst

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

2012-04-16 Thread Martin v. Löwis
Am 16.04.2012 19:44, schrieb Antoine Pitrou: > On Mon, 16 Apr 2012 13:33:45 -0400 > Brett Cannon wrote: >> On Mon, Apr 16, 2012 at 13:08, "Martin v. Löwis" wrote: >> So like execute hg diff on the dependent files and if nothing changed then touch the auto-generated file w/ 'touch' to pr

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

2012-04-16 Thread Amaury Forgeot d'Arc
Hi, 2012/4/16 Stefan Behnel > > On the down side, we would depend on Cython for evolving . > > Right, although not as a strict dependency. The code would still work just > fine in plain Python. Not quite, we are talking of the imp module here... -- Amaury Forgeot d'Arc __

Re: [Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

2012-04-16 Thread Antoine Pitrou
Le lundi 16 avril 2012 à 15:27 -0500, Brian Curtin a écrit : > On Mon, Apr 16, 2012 at 09:54, Brian Curtin wrote: > > On Mon, Apr 16, 2012 at 09:52, Brett Cannon wrote: > >> > >> > >> On Mon, Apr 16, 2012 at 07:19, Antoine Pitrou wrote: > >>> > >>> On Mon, 16 Apr 2012 07:10:31 +0200 > >>> brian.

Re: [Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

2012-04-16 Thread Brian Curtin
On Mon, Apr 16, 2012 at 09:54, Brian Curtin wrote: > On Mon, Apr 16, 2012 at 09:52, Brett Cannon wrote: >> >> >> On Mon, Apr 16, 2012 at 07:19, Antoine Pitrou wrote: >>> >>> On Mon, 16 Apr 2012 07:10:31 +0200 >>> brian.curtin wrote: >>> > PyErr_SetFromImportErrorWithNameAndPath >>> >>> Apparent

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

2012-04-16 Thread Stefan Behnel
"Martin v. Löwis", 16.04.2012 16:07: >> We have other instances of this (e.g. the Objects/typeslots.inc file >> is generated and checked in), but in the case of importlib, we have >> to use the ./python binary for freezing to avoid bytecode >> incompatibilities, which obviously is a problem if ./py

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

2012-04-16 Thread R. David Murray
On Mon, 16 Apr 2012 13:51:35 -0400, Barry Warsaw wrote: > On Apr 16, 2012, at 07:44 PM, Antoine Pitrou wrote: > > >Wouldn't it be better if Python could compile regardless of the > >presence of a hg repository? > > If you want it in your $DISTRO, yes please! My impression is that our usual solu

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

2012-04-16 Thread Barry Warsaw
On Apr 16, 2012, at 07:44 PM, Antoine Pitrou wrote: >Wouldn't it be better if Python could compile regardless of the >presence of a hg repository? If you want it in your $DISTRO, yes please! -Barry ___ Python-Dev mailing list Python-Dev@python.org http

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

2012-04-16 Thread Antoine Pitrou
On Mon, 16 Apr 2012 13:33:45 -0400 Brett Cannon wrote: > On Mon, Apr 16, 2012 at 13:08, "Martin v. Löwis" wrote: > > > > So like execute hg diff on the dependent files and if nothing changed > > > then touch the auto-generated file w/ 'touch' to prevent future attempts > > > to execute the targe

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

2012-04-16 Thread Eric Snow
On Mon, Apr 16, 2012 at 11:32 AM, Brett Cannon wrote: > > > On Mon, Apr 16, 2012 at 13:04, "Martin v. Löwis" wrote: >> >> > I don't see how depending on Cython is better than depending on having >> > an existing Python.  If the only benefit is semi-readable code, surely >> > we do have source cod

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

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 13:08, "Martin v. Löwis" wrote: > > So like execute hg diff on the dependent files and if nothing changed > > then touch the auto-generated file w/ 'touch' to prevent future attempts > > to execute the target? > > Exactly. There might be something better than hg diff, perh

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

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 13:04, "Martin v. Löwis" wrote: > > I don't see how depending on Cython is better than depending on having > > an existing Python. If the only benefit is semi-readable code, surely > > we do have source code for the pre-frozen module, and it is just a matter > > of convin

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

2012-04-16 Thread Martin v. Löwis
> So like execute hg diff on the dependent files and if nothing changed > then touch the auto-generated file w/ 'touch' to prevent future attempts > to execute the target? Exactly. There might be something better than hg diff, perhaps some form of hg status. Regards, Martin __

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

2012-04-16 Thread Martin v. Löwis
> I don't see how depending on Cython is better than depending on having > an existing Python. If the only benefit is semi-readable code, surely > we do have source code for the pre-frozen module, and it is just a matter > of convincing hg that the bytecode is binary, not text? Cython-generated C

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

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 12:31, Antoine Pitrou wrote: > On Mon, 16 Apr 2012 12:15:16 -0400 > "R. David Murray" wrote: > > > > I don't see how depending on Cython is better than depending on having > > an existing Python. If the only benefit is semi-readable code, surely > > we do have source cod

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

2012-04-16 Thread Antoine Pitrou
On Mon, 16 Apr 2012 12:15:16 -0400 "R. David Murray" wrote: > > I don't see how depending on Cython is better than depending on having > an existing Python. If the only benefit is semi-readable code, surely > we do have source code for the pre-frozen module, and it is just a matter > of convinci

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

2012-04-16 Thread R. David Murray
On Mon, 16 Apr 2012 11:21:34 -0400, Brett Cannon wrote: > On Mon, Apr 16, 2012 at 10:07, "Martin v. Löwis" wrote: > > > > We have other instances of this (e.g. the Objects/typeslots.inc file > > > is generated and checked in), but in the case of importlib, we have > > > to use the ./python bina

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

2012-04-16 Thread Barry Warsaw
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 mechanical guidelines for the look and feel of code, not so much for the seman

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

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 10:07, "Martin v. Löwis" wrote: > > We have other instances of this (e.g. the Objects/typeslots.inc file > > is generated and checked in), but in the case of importlib, we have > > to use the ./python binary for freezing to avoid bytecode > > incompatibilities, which obvio

Re: [Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

2012-04-16 Thread Brian Curtin
On Mon, Apr 16, 2012 at 09:52, Brett Cannon wrote: > > > On Mon, Apr 16, 2012 at 07:19, Antoine Pitrou wrote: >> >> On Mon, 16 Apr 2012 07:10:31 +0200 >> brian.curtin wrote: >> > PyErr_SetFromImportErrorWithNameAndPath >> >> Apparently this new function isn't documented anywhere. >> > > I forgot

Re: [Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

2012-04-16 Thread Brett Cannon
On Mon, Apr 16, 2012 at 07:19, Antoine Pitrou wrote: > On Mon, 16 Apr 2012 07:10:31 +0200 > brian.curtin wrote: > > PyErr_SetFromImportErrorWithNameAndPath > > Apparently this new function isn't documented anywhere. > > I forgot to write the docs for it when I committed Brian's code. Brian, do

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

2012-04-16 Thread Martin v. Löwis
> We have other instances of this (e.g. the Objects/typeslots.inc file > is generated and checked in), but in the case of importlib, we have > to use the ./python binary for freezing to avoid bytecode > incompatibilities, which obviously is a problem if ./python isn't > built yet. As for dependenc

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

2012-04-16 Thread Stefan Behnel
Antoine Pitrou, 16.04.2012 13:13: > On Mon, 16 Apr 2012 09:54:41 +0200 > Stefan Behnel wrote: >> >> The new import cache broke Cython's load of on-the-fly compiled extension >> modules, which naively used "__import__(module_name)" after building them. >> I could fix that by moving to "imp.load_dyna

Re: [Python-Dev] cpython: Fix #10854. Make use of the new path and name attributes on ImportError

2012-04-16 Thread Antoine Pitrou
On Mon, 16 Apr 2012 07:10:31 +0200 brian.curtin wrote: > PyErr_SetFromImportErrorWithNameAndPath Apparently this new function isn't documented anywhere. Regards Antoine. ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailm

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

2012-04-16 Thread Antoine Pitrou
On Mon, 16 Apr 2012 01:25:42 +0200 Victor Stinner wrote: > > I suppose that most people don't care that "resolution" and > "precision" are different things. Don't they? Actually, they don't care about resolution since they receive a Python float. Regards Antoine.

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

2012-04-16 Thread Antoine Pitrou
On Mon, 16 Apr 2012 09:54:41 +0200 Stefan Behnel wrote: > > The new import cache broke Cython's load of on-the-fly compiled extension > modules, which naively used "__import__(module_name)" after building them. > I could fix that by moving to "imp.load_dynamic()" (we know where we put > the compi

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

2012-04-16 Thread Oleg Broytman
On Mon, Apr 16, 2012 at 12:38:41PM +0200, Victor Stinner wrote: > Bikeshedding is maybe a common issue with the discussion around time > function? :-) Perhaps because everyone of us lives in a different Time-Space Continuum? ;-) Oleg. -- Oleg Broytmanhttp://phdru.name/

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

2012-04-16 Thread Victor Stinner
2012/4/16 Matt Joiner : > This is becoming the Manhattan Project of bike sheds. FreeBSD FAQ contains an entry "Why should I care what color the bikeshed is?" which mention a "sleep(1) should take fractional second arguments" saga in 1999. http://www.freebsd.org/doc/en/books/faq/misc.html#BIKESHED

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

2012-04-16 Thread Matt Joiner
This is becoming the Manhattan Project of bike sheds. ___ 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] Providing a mechanism for PEP 3115 compliant dynamic class creation

2012-04-16 Thread Daniel Urban
On Mon, Apr 16, 2012 at 04:17, Nick Coghlan wrote: > Sure, just create a new tracker issue and assign it to me. You already > know better than most what the _prepare() step needs to do :) I've created http://bugs.python.org/issue14588, and attached the first version of a patch. I can't assign it

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

2012-04-16 Thread Stefan Behnel
Brett Cannon, 14.04.2012 20:12: > My multi-year project -- started in 2006 according to my blog -- to rewrite > import in pure Python and then bootstrap it into CPython as *the* > implementation of __import__() is finally over (mostly)! Hopefully I didn't > break too much code in the process. =) W

Re: [Python-Dev] cpython: Issue #10576: Add a progress callback to gcmodule

2012-04-16 Thread Georg Brandl
On 15.04.2012 13:42, kristjan.jonsson wrote: http://hg.python.org/cpython/rev/88f8ef5785d7 changeset: 76319:88f8ef5785d7 user:Kristján Valur Jónsson date:Sun Apr 15 11:41:32 2012 + summary: Issue #10576: Add a progress callback to gcmodule files: Doc/library/gc.rst |

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

2012-04-16 Thread Paul Moore
On 15 April 2012 18:13, Raymond Hettinger wrote: > We should publish some advice on creating content managers. > > Context managers are a general purpose tool but have a primary > use case of creating and releasing resources.  This creates an > expectation that that is what the context managers ar