Re: [Python-Dev] New miniconf module

2006-07-29 Thread David Hopwood
Nick Coghlan wrote: > Sylvain Fourmanoit wrote: >>Armin Rigo wrote: >> >>>If it goes in that direction, I'd suggest to rename the module to give >>>it a name closer to existing persistence-related modules already in the >>>stdlib. >> >>I am not especially fond of the current miniconf name either; I

Re: [Python-Dev] New miniconf module

2006-07-28 Thread Nick Coghlan
Sylvain Fourmanoit wrote: > Armin Rigo wrote: >> If it goes in that direction, I'd suggest to rename the module to give >> it a name closer to existing persistence-related modules already in the >> stdlib. > > I am not especially fond of the current miniconf name either; I didn't > find something

Re: [Python-Dev] New miniconf module

2006-07-28 Thread Michael Foord
Sylvain Fourmanoit wrote: > Armin Rigo wrote: > >> In the same spirit, maybe it could be slightly re-oriented towards a >> dumper/loader for more than config files; for example, it could provide >> a safe inverse of repr() for common built-in types >> > > New version of miniconf (version

Re: [Python-Dev] New miniconf module

2006-07-28 Thread Sylvain Fourmanoit
Armin Rigo wrote: > In the same spirit, maybe it could be slightly re-oriented towards a > dumper/loader for more than config files; for example, it could provide > a safe inverse of repr() for common built-in types New version of miniconf (version 1.2.0) is out [1][2], including a unrepr() fun

Re: [Python-Dev] New miniconf module

2006-07-27 Thread Armin Rigo
Hi Michael, On Thu, Jul 27, 2006 at 12:46:04PM +0100, Michael Foord wrote: > > leaves for a safe and cross-version dumper/loader for simple objects > > using the Python syntax. In the same spirit, maybe it could be slightly > > re-oriented towards a dumper/loader for more than config files; for >

Re: [Python-Dev] New miniconf module

2006-07-27 Thread Michael Foord
Armin Rigo wrote: > Hi, > > On Thu, Jul 27, 2006 at 03:39:39AM -0400, Sylvain Fourmanoit wrote: > >> Having JSON there would indeed be nice: In fact, I recall being initially >> surprised it was not supported by the standard library. >> >> But is there a need to choose? Why not have both? The m

Re: [Python-Dev] New miniconf module

2006-07-27 Thread Armin Rigo
Hi, On Thu, Jul 27, 2006 at 03:39:39AM -0400, Sylvain Fourmanoit wrote: > Having JSON there would indeed be nice: In fact, I recall being initially > surprised it was not supported by the standard library. > > But is there a need to choose? Why not have both? The miniconf approach > has its adv

Re: [Python-Dev] New miniconf module

2006-07-27 Thread Sylvain Fourmanoit
An updated version is now available, based to the feedback of Phillip J. Eby and David Hopwood (stand-alone module[1], patch[2]): - the module is now reentrant - the sloppy case with Name nodes is now covered properly - the node lookup procedure was optimized, leading to a 20% speed increase on

Re: [Python-Dev] New miniconf module

2006-07-26 Thread John J Lee
On Wed, 26 Jul 2006, Phillip J. Eby wrote: [...] > Actually, I would see more reason to include JSON in the standard library, > since it's at least something approaching an internet protocol these days. +1 John ___ Python-Dev mailing list Python-Dev@p

Re: [Python-Dev] New miniconf module

2006-07-26 Thread Phillip J. Eby
At 05:43 PM 7/26/2006 -0400, Sylvain Fourmanoit wrote: > > The loading code could also be made a lot faster by using a dictionary > > mapping AST node types to functions, instead of doing string > > manipulation for each node. Each function could take 'pedantic' as a > > parameter, which would eli

Re: [Python-Dev] New miniconf module

2006-07-26 Thread Sylvain Fourmanoit
> It looks like it's trivial to fix; the code uses a strange and > unnecessary complication of creating nested classes and nested > singleton instances thereof. Getting rid of the singletons to create a > new instance for each dump/load call would suffice to make the > implementation re-entran

Re: [Python-Dev] New miniconf module

2006-07-26 Thread Sylvain Fourmanoit
> miniconf, OTOH, appears to have an interface compatible with capability > security (I have not checked that the compiler.ast module used in its > implementation is safe.) I woudn't be 100% sure either (obviously, I didn't write this nice piece of code, let alone the underlying parser), but I re

Re: [Python-Dev] New miniconf module

2006-07-26 Thread Phillip J. Eby
At 07:47 PM 7/26/2006 +0100, David Hopwood wrote: >Sylvain Fourmanoit wrote: > > I wrote a data persistence module called miniconf, aimed at making > > easy to create and safely retrieve configuration info from external, > > human-readable sources using Python syntax. I feel it would eventually > >

Re: [Python-Dev] New miniconf module

2006-07-26 Thread David Hopwood
Sylvain Fourmanoit wrote: > I wrote a data persistence module called miniconf, aimed at making > easy to create and safely retrieve configuration info from external, > human-readable sources using Python syntax. I feel it would eventually > make a nice addition to the standard library. >From a

[Python-Dev] New miniconf module

2006-07-26 Thread Sylvain Fourmanoit
I wrote a data persistence module called miniconf, aimed at making easy to create and safely retrieve configuration info from external, human-readable sources using Python syntax. I feel it would eventually make a nice addition to the standard library. The code was only newly refactored in this