Re: [Python-Dev] with_traceback

2007-02-28 Thread Shane Holloway
ch intern has it's own reference to its exception. I never really thought about it when they were just peer objects traveling up the stack. Just an idea from a different seat ;) -Shane Holloway ___ Python-Dev mailing list Python-Dev@python.

Re: [Python-Dev] whatever happened to string.partition ?

2006-05-25 Thread Shane Holloway (IEEE)
I will certainly look forward to using it. On May 25, 2006, at 16:21, Fredrik Lundh wrote: > does anyone remember? given what we're currently working on, > implementing it would take roughly no time at all. do people still > think it's a good idea ? > > > > __

Re: [Python-Dev] str object going in Py3K

2006-02-16 Thread Shane Holloway (IEEE)
On Feb 15, 2006, at 20:06, Greg Ewing wrote: > Barry Warsaw wrote: > >> If we go with two functions, I'd much rather hang them off of the >> file >> type object then add two new builtins. I really do think >> file.bytes() >> and file.text() (a.k.a. open.bytes() and open.text()) is better tha

Re: [Python-Dev] str with base

2006-01-19 Thread Shane Holloway (IEEE)
haps nbase? And maybe fbase for the floating point one... Thanks, -Shane Holloway #!/usr/bin/env python # #~ Imports # import math #~

Re: [Python-Dev] List copy and clear (was Re: Inconsistent API for sets.Set and build-in set)

2005-06-30 Thread Shane Holloway (IEEE)
Raymond Hettinger wrote: > I would think that that generic clearing is a lark. First, it only > applies to mutable objects. Second, it would likely only be useful in > the presence of a generic method for adding to the cleared container (as > opposed to the existing append(), add(), and setitem()

Re: [Python-Dev] Merging PEP 310 and PEP 340-redux?

2005-05-13 Thread Shane Holloway (IEEE)
+1 PEP 340 redux (although I marginally prefer the "with" keyword) Guido van Rossum wrote: > So then the all-important question I want to pose is: do we like the > idea of using a (degenerate, decorated) generator as a "template" for > the do-statement enough to accept the slightly increased compl

Re: [Python-Dev] PEP 340 -- loose ends

2005-05-04 Thread Shane Holloway (IEEE)
EXPR1" instead of "itr = iter(EXPR1)"? It seems to be a dis-symmetry with the 'for' loop specification. Thanks, -Shane (Holloway) ;) ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/pyt

Re: [Python-Dev] Pre-PEP: Unifying try-except and try-finally

2005-05-04 Thread Shane Holloway (IEEE)
And per the PEP, I think the explaining that:: try: A except: B else: C finally: D is *exactly* equivalent to:: try: try: A except: B else: C finally: D R

Re: [Python-Dev] PEP 340 - possible new name for block-statement

2005-04-29 Thread Shane Holloway (IEEE)
:" punctuation and subsequent indentation of the block for skimming code. -Shane Holloway ___ 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] defmacro (was: Anonymous blocks)

2005-04-25 Thread Shane Holloway (IEEE)
Aahz wrote: On Mon, Apr 25, 2005, Shane Holloway (IEEE) wrote: Interfaces:: def interface(interfaceName, *bases, ***aBlockSuite): blockGlobals = aBlockSuite.globals().copy() blockGlobals.update(aBlockSuite.locals()) blockLocals = {} exec aBlock in blockGlobals

Re: [Python-Dev] defmacro (was: Anonymous blocks)

2005-04-25 Thread Shane Holloway (IEEE)
cals and have them magically appear in the namespace. ;) Personally, I'm rather attached to "as (x, y):" introducing the block. To conclude, I mocked up some potential examples for your entertainment. ;) Thanks for your time and consideration! -Shane Holloway Interfaces:: d

Re: [Python-Dev] anonymous blocks

2005-04-20 Thread Shane Holloway (IEEE)
Aahz wrote: On Tue, Apr 19, 2005, Shane Holloway (IEEE) wrote: However, my opinion is that it does not read smoothly. This form requires that I say what I'm doing with something before I know the context of what that something is. For me, blocks are not about shortening the code, but r

Re: [Python-Dev] anonymous blocks

2005-04-19 Thread Shane Holloway (IEEE)
c = self.readPartC(aFile) return (a, b, c) and:: def readAndReturn(self, filename): withFile(filename): a = self.readPartA(aFile) b = self.readPartB(aFile) c = self.readPartC(aFile) return (a, b, c) Try it with yield to further vex

Re: [Python-Dev] frame.f_locals is writable

2005-01-14 Thread Shane Holloway (IEEE)
FWIW, this should work: def replaceFrame(self, ref, oldValue, newValue): for name, value in ref.f_locals.items(): if value is oldValue: exec "ref.f_locals[name] = newValue" assert ref.f_locals[name] is newValue And, no, you don't have to tell

Re: [Python-Dev] frame.f_locals is writable

2005-01-14 Thread Shane Holloway (IEEE)
Brett C. wrote: Other option would be to add a function that either directly modified single values in f_localsplus, a function that takes a dict and propogates the values, or a function that just calls PyFrame_LocalsToFast() . Brett!! Thanks for looking this up! With a little help from ctypes

[Python-Dev] frame.f_locals is writable

2005-01-13 Thread Shane Holloway (IEEE)
ected on the invocation of the function. This is a subtle issue with reloading code, and can be documented. And at best there is an effective way to replace it, the system can be changed to a consistent state even in the stack, and I can rejoice. Even if I have to wait until 2.5. ;

Re: [Python-Dev] Let's get rid of unbound methods

2005-01-05 Thread Shane Holloway (IEEE)
Alex Martelli wrote: def f(*a): pass class C(object): pass class D(object): pass C.f = D.f = f If now we want C.f.im_class to differ from D.f.im_class then we need f to get copied implicitly when it's assigned to C.f (or, of course, when C.f is accessed... but THAT might be substantial overhead).

Re: [Python-Dev] Zipfile needs?

2005-01-03 Thread Shane Holloway (IEEE)
the ability to remove a file in the archive, as well as "write over" a file already in the archive. It's a tall order, but you asked. ;) Thanks, -Shane Holloway ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.o