Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Meador Inge
On Tue, Jan 26, 2010 at 9:35 PM, David Lyon wrote: > One problem is that in many places, users are trained specifically > under windows to *never* run anything in a zip file. As it might > contain a virus and "bring down the whole company network". I have even hit cases where Windows flat out bloc

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread David Lyon
Glen wrote: > So let's further say that the .zip file was named .py, instead, but was > a .zip internally. The only one thing I have to say about that is that it makes embedding of .py files recursive. So, it begs the question "How many times can you embed a .py within a .py?" And then; "How do

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Terry Reedy
On 1/26/2010 6:17 PM, Collin Winter wrote: 70MB of the increase was indeed debug information. Since the Linux distros that I checked ship stripped Python binaries, I've stripped the Unladen Swallow binaries as well, and while the size increase is still significant, it's not as large as it once w

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Cameron Simpson
On 26Jan2010 01:57, Terry Reedy wrote: | On 1/25/2010 9:32 PM, Nick Coghlan wrote: | >However, as Cameron pointed out, the O() value for an operation is an | >important characteristic of containers, and having people get used to an | >O(1) list.pop(0) in CPython could create problems not only for

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread David Lyon
Glen wrote: > So let's say that the .zip file was dropped onto the Desktop or start > menu. It would have an icon, then. It would have an icon. But nothing to identify it as a python application. One problem is that in many places, users are trained specifically under windows to *never* run any

[Python-Dev] [Fwd: RE: [PSF-Board] Microsoft contributor agreement received?]

2010-01-26 Thread Steve Holden
Please note that both Dino Viehland and Dave Fugate are now signed up to make commits in the name of Microsoft Corporation. I believe this just formalizes existing working relationships, but what would *I* know ... Thanks, everybody. As you were. regards Steve Original Message

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Collin Winter
Hey Martin, On Thu, Jan 21, 2010 at 2:25 PM, "Martin v. Löwis" wrote: > Reid Kleckner wrote: >> On Thu, Jan 21, 2010 at 4:34 PM, "Martin v. Löwis" >> wrote: How large is the LLVM shared library? One surprising data point is that the binary is much larger than some of the memory footpr

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread M.-A. Lemburg
Benjamin Peterson wrote: > 2010/1/25 Steve Howell : >> I am interested in creating a patch to make deleting elements from the front >> of Python list work in O(1) time by advancing the ob_item pointer. > > How about just using a deque? ... or a stack: http://www.egenix.com/products/pytho

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Collin Winter
Hi Cesare, On Tue, Jan 26, 2010 at 12:29 AM, Cesare Di Mauro wrote: > Hi Collin, > > One more question: is it easy to support more opcodes, or a different opcode > structure, in Unladen Swallow project? I assume you're asking about integrating WPython. Yes, adding new opcodes to Unladen Swallow

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Martin v. Löwis
> This > may not be a problem in the LLVM code base, but it is the typical > problem that C++ devs run into with initialization of objects with > static storage duration. This *really* doesn't have to do anything with U-S, but I'd like to point out that standard C++ has a very clear semantics in t

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Raymond Hettinger
>> >> Ah, but that applies for *large* lists. Adding 8 bytes to >> each list >> object applies to *all* lists. I betcha that many programs >> use many >> tiny lists. >> > > Even most tiny-ish lists are wasting memory, though, according to this > sequence: > > 4, 8, 16, 25, ... > That is onl

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Daniel Stutzbach
On Tue, Jan 26, 2010 at 3:32 PM, Steve Howell wrote: > Even most tiny-ish lists are wasting memory, though, according to this > sequence: > > 4, 8, 16, 25, ... > Several operations will allocate a list of exactly the right size, wasting no memory. In particular, a fixed-size list will always be

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Paul Moore
2010/1/26 Ian Bicking : > On Tue, Jan 26, 2010 at 2:44 PM, Glyph Lefkowitz > wrote: >> >> On Jan 26, 2010, at 3:20 PM, Ian Bicking wrote: >> >> Sadly you can't then do: >>   chmod +x mz.py >>   ./mz.py >> >> Unless I missed some subtlety earlier in the conversation, yes you can :). > > You are ent

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
> From: Guido van Rossum > Steve Howell > wrote: > > It seems to me that the goal of keeping lists > > super-compact from a memory standpoint is contradicted by > > the code in list_resize that optimistically preallocates > > extra memory on appends. > > Ah, but that applies for *large* lists. A

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Terry Reedy
On 1/26/2010 7:51 AM, Steve Howell wrote: From: Nick Coghlan Steve, I suggest creating a new issue at bugs.python.org to track your proposal rather than sending diffs to the list. I was about to suggest the same thing. Even if your final patch is not currently accepted, it will remain on the

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Nick Coghlan
Adam Olsen wrote: > This is a much better optimization than the string appending > optimization, as it is both portable and robust. > > I find it shocking to change a semantic I've come to see as a core > part of the language, but I can't come up with a rational reason to > oppose it. The approac

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Guido van Rossum
On Tue, Jan 26, 2010 at 12:46 PM, Steve Howell wrote: > It seems to me that the goal of keeping lists super-compact from a memory > standpoint is contradicted by the code in list_resize that optimistically > preallocates extra memory on appends. Ah, but that applies for *large* lists. Adding 8

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Nick Coghlan
Glyph Lefkowitz wrote: > This use-case was specifically mentioned on > , too. Thanks glyph, I was going to dig up that link, but now I don't have to :) Regards, Nick. -- Nick Coghlan | ncogh...@gmail.com | Brisbane, Australia

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Ian Bicking
On Tue, Jan 26, 2010 at 2:44 PM, Glyph Lefkowitz wrote: > > On Jan 26, 2010, at 3:20 PM, Ian Bicking wrote: > > Sadly you can't then do: > > chmod +x mz.py > ./mz.py > > > Unless I missed some subtlety earlier in the conversation, yes you can :). > You are entirely correct; I accidentally was

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
From: Guido van Rossum > > So here's how you can fix it: go to "Edit Issue" and change > the > "Base:" field to the following: > > http://svn.python.org/view/*checkout*/python/trunk/ > I just deleted the issue altogether for now, since the preferred approach is to use a pointer, and that's gon

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Glyph Lefkowitz
On Jan 26, 2010, at 3:20 PM, Ian Bicking wrote: > Sadly you can't then do: > > chmod +x mz.py > ./mz.py Unless I missed some subtlety earlier in the conversation, yes you can :). > because it doesn't have "#!/usr/bin/env python" like typical executable > Python scripts have. You can put t

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Paul Moore
2010/1/26 Ian Bicking : > On Tue, Jan 26, 2010 at 1:40 PM, Paul Moore wrote: >> You're right, it works: >> >> >type __main__.py >> print "Hello from a zip file" >> >> >zip mz.py __main__.py >>  adding: __main__.py (172 bytes security) (stored 0%) >> >> >mz.py >> Hello from a zip file > > Sadly you

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Ian Bicking
On Tue, Jan 26, 2010 at 1:40 PM, Paul Moore wrote: > 2010/1/26 Nick Coghlan : > > Glenn Linderman wrote: > >> That would seem to go a long ways toward making the facility user > >> friendly, at least on Windows, which is where your complaint about icons > >> was based, and the only change to Pyth

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Guido van Rossum
On Tue, Jan 26, 2010 at 11:36 AM, Steve Howell wrote: > --- On Tue, 1/26/10, Guido van Rossum wrote: > >> From: Guido van Rossum >> Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time >> To: "Steve Howell" >> Cc: "Nick Coghlan" , python-dev@python.org >> Date: Tuesday, January

Re: [Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Paul Moore
2010/1/26 Nick Coghlan : > Glenn Linderman wrote: >> That would seem to go a long ways toward making the facility user >> friendly, at least on Windows, which is where your complaint about icons >> was based, and the only change to Python would be to recognize that if a >> .py contains a .zip signa

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
--- On Tue, 1/26/10, Guido van Rossum wrote: > From: Guido van Rossum > Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time > To: "Steve Howell" > Cc: "Nick Coghlan" , python-dev@python.org > Date: Tuesday, January 26, 2010, 11:17 AM > On Tue, Jan 26, 2010 at 10:01 AM, > Steve

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Guido van Rossum
On Tue, Jan 26, 2010 at 10:01 AM, Steve Howell wrote: > The patch is now on Rietveld. > > http://codereview.appspot.com/194083/show > > I wsa getting HTTP errors for certain operations, like trying to publish > comments, but I am able to see the patch there. Hey Steve, You seem to be using Riet

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Adam Olsen
On Mon, Jan 25, 2010 at 23:57, Terry Reedy wrote: > On 1/25/2010 9:32 PM, Nick Coghlan wrote: > >> However, as Cameron pointed out, the O() value for an operation is an >> important characteristic of containers, and having people get used to an >> O(1) list.pop(0) in CPython could create problems

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
The patch is now on Rietveld. http://codereview.appspot.com/194083/show I wsa getting HTTP errors for certain operations, like trying to publish comments, but I am able to see the patch there. Here is the issue tracker link: http://bugs.python.org/issue7784 Here is a rough draft of a proposal

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Alexandre Vassalotti
On Tue, Jan 26, 2010 at 7:04 AM, Yingjie Lan wrote: >> note that this is quite off-topic for this list, which is >> about the >> development of the CPython interpreter and runtime >> environment. > > Sorry if this is bothering you. I thought here are a lot of people who knows > how to write exten

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Glenn Linderman
On approximately 1/26/2010 1:27 AM, came the following characters from the keyboard of Stefan Behnel: Michael Foord, 26.01.2010 01:14: How great is the complication? Making list.pop(0) efficient sounds like a worthy goal, particularly given that the reason you don't use it is because you *kn

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
--- On Tue, 1/26/10, Antoine Pitrou wrote: > From: Antoine Pitrou > Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time > To: python-dev@python.org > Date: Tuesday, January 26, 2010, 12:50 AM > Terry Reedy > udel.edu> writes: > > > > The idea that CPython should not be impro

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
--- On Tue, 1/26/10, Daniel Stutzbach wrote: > Just to be clear, when you say "all tests" do you > mean "all of the list tests" or "the full > Python test suite"? > The full suite, minus some tests that skipped on my platform. The last patch I posted was broken on test_sys.py, but I have si

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Daniel Stutzbach
On Tue, Jan 26, 2010 at 1:17 AM, Steve Howell wrote: > Ok, I fixed the obvious segfaults, and I am now able to pass all the tests > on my debug build. A new diff is attached. > Just to be clear, when you say "all tests" do you mean "all of the list tests" or "the full Python test suite"? -- Da

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Cesare Di Mauro
Hi Skip For "relatively stable code" I talk about recent years. My experience with CPython is limited, of course. Cesare 2010/1/26 > >Cesare> ... but ceval.c has a relatively stable code ... > > I believe you are mistaken on several counts: > >* The names of the functions in there hav

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Floris Bruynooghe
On Tue, Jan 26, 2010 at 04:40:29AM -0800, Yingjie Lan wrote: > I googled c.l.py but found > few pages (one link said it is a dead list, but anyway), > would you care give the information > where to join it? comp.lang.python newsgroup, see: http://python.org/community/lists/ Regards Floris --

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
> From: Nick Coghlan > > Steve, I suggest creating a new issue at bugs.python.org to > track your > proposal rather than sending diffs to the list. Agreed. After sending out the second, still slightly broken diff, I realized that I probably needed to read up on the process. You can find the

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Yingjie Lan
> Note that pretty much everyone who reads this list will > likely also read > c.l.py, but c.l.py has a much broader audience, including a > lot of people > who write extension modules in one way or another. Thanks for the note. I googled c.l.py but found few pages (one link said it is a dead li

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Nick Coghlan
Yingjie Lan wrote: >> note that this is quite off-topic for this list, which is about the >> development of the CPython interpreter and runtime environment. > > Sorry if this is bothering you. I thought here are a lot of people > who knows how to write extensions, and has a lot of experiences. >

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Stefan Behnel
Yingjie Lan, 26.01.2010 13:04: >> note that this is quite off-topic for this list, which is about the >> development of the CPython interpreter and runtime environment. > > Sorry if this is bothering you. No problem. > I thought here are a lot of people who > knows how to write extensions, and

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Michael Foord
On 26/01/2010 12:04, Yingjie Lan wrote: note that this is quite off-topic for this list, which is about the development of the CPython interpreter and runtime environment. Sorry if this is bothering you. I thought here are a lot of people who knows how to write extensions, and has a lot o

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Nick Coghlan
Steve Howell wrote: > Ok, I fixed the obvious segfaults, and I am now able to pass all the > tests on my debug build. A new diff is attached. Steve, I suggest creating a new issue at bugs.python.org to track your proposal rather than sending diffs to the list. Putting the patch code up on Rietvel

Re: [Python-Dev] Rich Comparison recipe wrong?

2010-01-26 Thread Michael Foord
On 26/01/2010 12:22, Nick Coghlan wrote: Lennart Regebro wrote: It never gets to that root comparison, as several of that types comparisons just refer back to the type who returns NotImplemented. To solve it you need to never refer to the other type in your comparisons. And as far as I see t

Re: [Python-Dev] Rich Comparison recipe wrong?

2010-01-26 Thread Nick Coghlan
Lennart Regebro wrote: > It never gets to that root comparison, as several of that types > comparisons just refer back to the type who returns NotImplemented. To > solve it you need to never refer to the other type in your > comparisons. And as far as I see that makes it impossible to implement > f

[Python-Dev] Executing zipfiles and directories (was Re: PyCon Keynote)

2010-01-26 Thread Nick Coghlan
Glenn Linderman wrote: > That would seem to go a long ways toward making the facility user > friendly, at least on Windows, which is where your complaint about icons > was based, and the only change to Python would be to recognize that if a > .py contains a .zip signature, That should work today -

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Yingjie Lan
> note that this is quite off-topic for this list, which is > about the > development of the CPython interpreter and runtime > environment. Sorry if this is bothering you. I thought here are a lot of people who knows how to write extensions, and has a lot of experiences. These are exactly the be

Re: [Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Stefan Behnel
Yingjie Lan, 26.01.2010 12:41: > I am working on a project named expy, which intends to be an express way > to extend Python (currently only supports extension in C, but could be > easily expaned to support more languages). With expy you can write your > code as a real python module, then expy woul

[Python-Dev] Help wanted on a code generator project

2010-01-26 Thread Yingjie Lan
Hi, I am working on a project named expy, which intends to be an express way to extend Python (currently only supports extension in C, but could be easily expaned to support more languages). With expy you can write your code as a real python module, then expy would generate the actual code. I'

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread skip
Cesare> ... but ceval.c has a relatively stable code ... I believe you are mistaken on several counts: * The names of the functions in there have changed over time. * The suite of byte code operations have changed dramatically over the past ten years or so. * The relati

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Floris Bruynooghe
Hello Collin On Mon, Jan 25, 2010 at 05:27:38PM -0800, Collin Winter wrote: > On Mon, Jan 25, 2010 at 1:25 PM, Floris Bruynooghe > wrote: > > On Mon, Jan 25, 2010 at 10:14:35AM -0800, Collin Winter wrote: > >> I'm working on a patch to completely remove all traces of C++ with > >> configured with

Re: [Python-Dev] PyCon Keynote

2010-01-26 Thread Michael Foord
On 26/01/2010 05:27, David Lyon wrote: At 03:15 PM 1/26/2010 +1100, David Lyon wrote: With all due respect, that process is a bit like a black magic approach. Maybe the capability is there, but it isn't very well documented and it isn't obvious. I don't see what's so hard about:

Re: [Python-Dev] Possible changes to handling of default encoding for text files (was Re: Proposed downstream change to site.py in Fedora (sys.defaultencoding))

2010-01-26 Thread M.-A. Lemburg
Nick Coghlan wrote: > Tres Seaver wrote: >>> Perhaps we could also add a warning to the open() API which warns >>> in case a file is opened in text mode without specifying an >>> encoding ?! >> >> That sounds like a good plan to me, given that backward-compatibility >> requires keeping the guessing

Re: [Python-Dev] Rich Comparison recipe wrong?

2010-01-26 Thread Lennart Regebro
On Tue, Jan 26, 2010 at 09:15, Юлий Тихонов wrote: > It looks like __cmp__, not __lt__ method. Oh, yeah, sorry. I copy/pasted code from my code where I use __cmp__, :) > However, with this replacement test also falls into recursion. Told ya. :) -- Lennart Regebro: Python, Zope, Plone, Grok htt

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Steve Howell
--- On Tue, 1/26/10, Stefan Behnel wrote: > From: Stefan Behnel > Subject: Re: [Python-Dev] patch to make list.pop(0) work in O(1) time > To: python-dev@python.org > Date: Tuesday, January 26, 2010, 1:27 AM > Michael Foord, 26.01.2010 01:14: > > How great is the complication? Making list.pop(0) >

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Stefan Behnel
Michael Foord, 26.01.2010 01:14: > How great is the complication? Making list.pop(0) efficient sounds like > a worthy goal, particularly given that the reason you don't use it is > because you *know* it is inefficient I agree. Given a programmer the insight that lists are implemented as arrays in

Re: [Python-Dev] patch to make list.pop(0) work in O(1) time

2010-01-26 Thread Antoine Pitrou
Terry Reedy udel.edu> writes: > > The idea that CPython should not be improved because it would spoil > programmers strikes me as a thin, even desparate objection. One could > say that same thing about the recent optimization of string += string so > that repeated concats are O(n) instead of O

Re: [Python-Dev] Rich Comparison recipe wrong?

2010-01-26 Thread Jack Diederich
On Mon, Jan 25, 2010 at 6:59 AM, Lennart Regebro wrote: [snip] > If class A returns NotImplemented when compared to class B, and class > B implements the recipe above, then we get infinite recursion, because > > 1. A() < B() will call A.__lt__(B) which will return NotImplemented. > 2. which will m

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Cesare Di Mauro
Hi Collin, One more question: is it easy to support more opcodes, or a different opcode structure, in Unladen Swallow project? Thanks, Cesare ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscrib

Re: [Python-Dev] Rich Comparison recipe wrong?

2010-01-26 Thread Юлий Тихонов
# compare_test.py @total_ordering class StrictComparator(object): <...> def __lt__(self, other): if not isinstance(other, StrictComparator): return NotImplemented else: return (self.v > other.v) - (self.v < other.v) It lo

Re: [Python-Dev] PyCon Keynote

2010-01-26 Thread Glenn Linderman
On approximately 1/25/2010 9:27 PM, came the following characters from the keyboard of David Lyon: Firstly, it doesn't create create desktop shortcuts - sorry users need those. Where do the programs go? So let's say that the .zip file was dropped onto the Desktop or start menu. It would h

Re: [Python-Dev] PEP 3146: Merge Unladen Swallow into CPython

2010-01-26 Thread Cesare Di Mauro
Hi Collin, 2010/1/25 Collin Winter > Hi Cesare, > > On Sat, Jan 23, 2010 at 1:09 PM, Cesare Di Mauro > wrote: > > Hi Collin > > > > IMO it'll be better to make Unladen Swallow project a module, to be > > installed and used if needed, so demanding to users the choice of having > it > > or not. T