Re: [Python-Dev] Requesting that a class be a new-style class

2005-02-19 Thread Jack Diederich
can put "__metaclass__ == type" at the top of modules :) I always use new style classes so I only have to remember one set of behaviors. "__metaclass__ = type" is warty, it has the "action at a distance" problem that decorators solve for functions. I didn

Re: [Python-Dev] Adding any() and all()

2005-03-10 Thread Jack Diederich
someone else won't notice. [in fact we had a guy who was "downsized" for doing things like calling database queries on the return value of a function that was documented as returning True/False] Perl shops require long style guides becuase perl is, ummm, perl. Python is a b

[Python-Dev] Problems with definition of _POSIX_C_SOURCE

2005-03-16 Thread Jack Jansen
d, thus, potentially non-posix-compliant) code... This problem is currently stopping Python 2.4.1 to compile on this platform, so if anyone can provide any insight that would be very helpful... -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If I can't dance I don't w

Re: [Python-Dev] @decoration of classes

2005-03-28 Thread Jack Diederich
On Mon, Mar 28, 2005 at 09:25:18AM -0800, Michael Chermside wrote: > Josiah Carlson writes: > > [... stuff about reST and TeX ...] > > While I have not used it often, I have done the equivalent of decorating > > classes; it is as natural (though perhaps not quite as useful initially) > > as d

Re: [Python-Dev] @decoration of classes

2005-03-28 Thread Jack Diederich
On Sat, Mar 26, 2005 at 12:36:08PM -0800, Josiah Carlson wrote: > > Eric Nieuwland <[EMAIL PROTECTED]> wrote: > > > > Given the ideas so far, would it possible to: > > > > def meta(cls): > > ... > > > > @meta > > class X(...): > > ... > > It is not implemented in Python 2.4. From what

Re: [Python-Dev] Re: marshal / unmarshal

2005-04-15 Thread Jack Jansen
C) stored 32 bit integers in middle-endian (high-order word first, but low-order byte first). But note that neither of the PDP-11 FPUs were IEEE, that was a much later invention. At least, I didn't come across it until much later:-) -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl

Re: [Python-Dev] Inconsistent exception for read-only properties?

2005-04-17 Thread Jack Diederich
On Sat, Apr 16, 2005 at 07:24:27PM -0400, Barry Warsaw wrote: > On Thu, 2005-04-14 at 23:46, Barry Warsaw wrote: > > I've noticed an apparent inconsistency in the exception thrown for > > read-only properties for C extension types vs. Python new-style > > classes. > > I haven't seen any follow ups

Re: [Python-Dev] Inconsistent exception for read-only properties?

2005-04-17 Thread Jack Diederich
On Sun, Apr 17, 2005 at 11:53:31AM -0400, Jack Diederich wrote: > On Sat, Apr 16, 2005 at 07:24:27PM -0400, Barry Warsaw wrote: > > On Thu, 2005-04-14 at 23:46, Barry Warsaw wrote: > > > I've noticed an apparent inconsistency in the exception thrown for > > > read

Re: [Python-Dev] anonymous blocks

2005-04-19 Thread Jack Diederich
On Tue, Apr 19, 2005 at 01:33:15PM -0700, Guido van Rossum wrote: > > @acquire(myLock): > > code > > code > > code > > It would certainly solve the problem of which keyword to use! :-) And > I think the syntax isn't even ambiguous -- the trailing colon > distinguishes this from the fun

Re: [Python-Dev] PEP 343 - Abstract Block Redux

2005-05-16 Thread Jack Diederich
On Mon, May 16, 2005 at 06:24:59PM +1200, Greg Ewing wrote: > Brett C. wrote: > > > Nick's was obviously directly against looping, but, with no offense to Nick, > > how many other people were against it looping? It never felt like it was a > > screaming mass with pitchforks but more of a "I don't

Re: [Python-Dev] PEP 344: Exception Chaining and Embedded Tracebacks

2005-05-16 Thread Jack Diederich
On Mon, May 16, 2005 at 08:09:54PM -0500, Ka-Ping Yee wrote: > On Mon, 16 May 2005, Aahz wrote: > > I'll comment here in hopes of staving off responses from multiple > > people: I don't think these should be double-underscore attributes. The > > currently undocumented ``args`` attribute isn't doub

Re: [Python-Dev] PEP 344: Exception Chaining and Embedded Tracebacks

2005-05-16 Thread Jack Diederich
On Mon, May 16, 2005 at 10:11:47PM -0400, Jack Diederich wrote: > The values are never shared by expections of the class ^^ s/expect/except/ Exceptions are expected by except statements - and ispell can't tell the difference. -

Re: [Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-14 Thread Jack Jansen
}; > ... > if (!PyArg_ParseTupleAndKeywords(args,kws,format,kwslist,&a1)) > goto onError; At least this appears to work... -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman _

Re: [Python-Dev] bytes type discussion

2006-02-16 Thread Jack Diederich
nk that back when the gas price was just below 10 SEK/L, > but they found a way... > Of course they found a way. The alternative was cutting taxes. whish-I-was-winking, -Jack ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.or

Re: [Python-Dev] Proposal: defaultdict

2006-02-17 Thread Jack Diederich
On Thu, Feb 16, 2006 at 01:11:49PM -0800, Guido van Rossum wrote: [snip] > Google has an internal data type called a DefaultDict which gets > passed a default value upon construction. Its __getitem__ method, > instead of raising KeyError, inserts a shallow copy (!) of the given > default value into

Re: [Python-Dev] Counter proposal: multidict (was: Proposal: defaultdict)

2006-02-17 Thread Jack Diederich
y many user defined objects. By assigning the default value in __getitem__ the returned value can be manipulated via its methods. -Jack ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: htt

Re: [Python-Dev] Webstats for www.python.org et al.

2006-03-01 Thread Jack Diederich
's that "Java/1.4.2_03" user agent doing? (it's responsible for > > 10% of all hits in january/february, and 20% of the hits today...) > > Most likely a crawler. > Youch, if I'm reading it right it consumed fully half of the bandwidth for today on python.org

Re: [Python-Dev] collections.idset and collections.iddict?

2006-03-06 Thread Jack Diederich
bject equivalent to the one I am checking for. >>> a = set([1,2,3,4]) >>> b = set([1,2,3,4]) >>> a == b True >>> a is b False >>> container = [a] >>> b in container True >>> container = [id(a)] >>> id(b) in container False &g

Re: [Python-Dev] Class decorators

2006-03-28 Thread Jack Diederich
to push this > > into 2.5 though; how about 2.6? > > Wasn't there already a (pretty small) patch? I guess it would be > different now with the AST though. > I submitted one a couple years ago. The AST makes it obsolete though. I'd be happ

Re: [Python-Dev] Class decorators

2006-03-29 Thread Jack Diederich
On Wed, Mar 29, 2006 at 01:11:06AM -0500, Fred L. Drake, Jr. wrote: > On Wednesday 29 March 2006 00:48, Fred L. Drake, Jr. wrote: > > I think the existing usage for classes is perfectly readable. The > > @-syntax works well for functions as well. > > On re-reading what I wrote, I don't think I

Re: [Python-Dev] Class decorators

2006-03-29 Thread Jack Diederich
On Wed, Mar 29, 2006 at 07:23:03PM -0500, Phillip J. Eby wrote: > At 11:07 AM 3/29/2006 -0800, Guido van Rossum wrote: > >On 3/28/06, Phillip J. Eby <[EMAIL PROTECTED]> wrote: > > > If we're using Zope 3 as an example, I personally find that: > > > > > > class Foo: > > > """Docstring

Re: [Python-Dev] Class decorators

2006-03-29 Thread Jack Diederich
[promted by Phillip Eby's post, but not in response so content snipped] I think we both want class decorators as a more fine grained substitute for __metaclass__ (fine grained as in declared per-class-instance instead of this-class-and-all-its-children). I can think of three ways class decorators

Re: [Python-Dev] Let's stop eating exceptions in dict lookup

2006-06-01 Thread Jack Diederich
. The CCP Games CEO said they have trouble retaining talent from more moderate latitudes for this reason. 18 hours of daylight makes them a bit goofy and when the Winter Solstice rolls around they are apt to go quite mad. -Jack ___ Python-Dev mailing

Re: [Python-Dev] Proposal to eliminate PySet_Fini

2006-07-02 Thread Jack Diederich
for things that have some extra setup involved (tuples have a free list for each length). -Jack ___ 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] [Python-checkins] python/dist/src/Tools/bgen/bgen bgenGenerator.py, 1.17, 1.18 bgenObjectDefinition.py, 1.29, 1.30 bgenType.py, 1.15, 1.16 bgenVariable.py, 1.6, 1.7 scantools.py, 1.37

2005-06-26 Thread Jack Jansen
; bgenVariable.py scantools.py > Log Message: > Normalize whitespace to avoid offending Bug Day volunteers. Argh, sorry... I thought I had all my machines educated to do tab expansion for Python, but apparently not... -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If

Re: [Python-Dev] Chaining try statements: eltry?

2005-07-07 Thread Jack Diederich
; "fails". I use else similarly, for defensive programming. for (thing) in searchlist: if (matches(thing)): keeper = thing break else: raise ValueError("No thing matches()") I can't say I use it for much else, if I really want a default I do found = None

Re: [Python-Dev] Pre-PEP: Exception Reorganization for Python 3.0

2005-07-30 Thread Jack Diederich
On Sat, Jul 30, 2005 at 06:41:51PM +1000, Nick Coghlan wrote: > Brett Cannon wrote: > > Don't forget this is Python 3.0; if it makes more sense we can break code. > > Or if he can be persuaded that ControlFlowException should exist as a peer of > Exception and CriticalException. . . > > >>>+

Re: [Python-Dev] Major revision of PEP 348 committed

2005-08-09 Thread Jack Diederich
client_name = names[client_id] ValueError, TypeError, AttributeError (2 instances) ValueError, TypeError, KeyError (3 instances) ValueError, TypeError, IndexError (3 instances) And finally this one because bsddb can say "Failed" in more than one way.

Re: [Python-Dev] PEP 347: Migration to Subversion

2005-08-16 Thread Jack Diederich
enough. bzr might make it even easier but svn is familiar and it will work right now. I haven't submitted a patch in ages partly because using anonymous SF cvs plain doesn't work. aside, at work we switched from cvs to svn and it the transition was easy for developers, svn lives up to

Re: [Python-Dev] itertools.chain should take an iterable ?

2005-09-01 Thread Jack Diederich
On Thu, Sep 01, 2005 at 07:58:40PM +0200, Paolino wrote: > Working on a tree library I've found myself writing > itertools.chain(*[child.method() for child in self]). > Well this happened after I tried instinctively > itertools.chain(child.method() for child in self). > > Is there a reason for t

Re: [Python-Dev] Replacement for print in Python 3.0

2005-09-01 Thread Jack Diederich
On Thu, Sep 01, 2005 at 02:46:13PM -0600, Charles Cazabon wrote: > Bill Janssen <[EMAIL PROTECTED]> wrote: > > I don't use "print" myself much, but for the occasional 3-line script. > > But I think the user-friendliness of it is a good point, and makes up > > for the weirdness of it all. There's s

Re: [Python-Dev] Replacement for print in Python 3.0

2005-09-01 Thread Jack Diederich
On Thu, Sep 01, 2005 at 11:12:57PM +0200, Fredrik Lundh wrote: > Charles Cazabon wrote: > > > in fact, it does nothing for the program but merely has the interesting > > side-effect of writing to stdout. > > yeah, real programmers don't generate output. > I'd say: yeah, real programmers don't

Re: [Python-Dev] For/while/if statements/comprehension/generator expressions unification

2005-09-20 Thread Jack Diederich
On Tue, Sep 20, 2005 at 10:20:44AM -0700, Josiah Carlson wrote: > Try using the code I offered. It allows the cross of an aribitrary > number of restartable iterables, in the same order as an equivalent list > comprehension or generator expression. > > >>> list(cross([1,2], [3,4], [5,6])) > [(1,

Re: [Python-Dev] Adding a conditional expression in Py3.0

2005-09-20 Thread Jack Diederich
On Tue, Sep 20, 2005 at 09:04:53AM -0700, Guido van Rossum wrote: > On 9/20/05, Michael Hudson <[EMAIL PROTECTED]> wrote: > > Guido van Rossum <[EMAIL PROTECTED]> writes: > > > > > On 9/19/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > > >> I propose that in Py3.0, the "and" and "or" operators

Re: [Python-Dev] __doc__ behavior in class definitions

2005-10-07 Thread Jack Diederich
On Fri, Oct 07, 2005 at 12:15:04PM -0700, Martin Maly wrote: > Hello Python-Dev, > > My name is Martin Maly and I am a developer at Microsoft, working on the > IronPython project with Jim Hugunin. I am spending lot of time making > IronPython compatible with Python to the extent possible. > > I

[Python-Dev] Proposal: can we have a python-dev-announce mailing list?

2005-11-03 Thread Jack Jansen
ople developing Python. Even during times when I am actively following python-dev it would be handy to have important announcements coming in in a separate mailbox in stead of buried under design discussions and such... -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If I can

Re: [Python-Dev] Proposal: can we have a python-dev-announce mailing list?

2005-11-03 Thread Jack Jansen
On 3-nov-2005, at 22:36, Oleg Broytmann wrote: > On Thu, Nov 03, 2005 at 10:29:37PM +0100, Jack Jansen wrote: > >> I know I would be much helped with a moderated python-dev-announce >> mailing list, which would be only low-volume >> > >http://www.google.com/se

Re: [Python-Dev] mac memory leaks

2006-01-03 Thread Jack Jansen
There don't seem to be any mac-specific modules involved... > Leak: 0x0118ad10 size=80 > Call stack: call_function | AE_AECreateDesc | AECreateDesc | operator > new(unsigned long) Hmm, the first candidates here would be test_aepack and test_scriptpackages, but neither one has an obvi

Re: [Python-Dev] str with base

2006-01-17 Thread Jack Diederich
x27;%b'). The suggestion is to add 'b' as a sprintf-like format string %[][.]b Where the optional is the base to print in and is the optional minimum length of chars to print (as I recall). Default is base 2. Me? I like it. -Jack ___

Re: [Python-Dev] str with base

2006-01-17 Thread Jack Diederich
On Tue, Jan 17, 2006 at 06:11:36PM -0800, Bob Ippolito wrote: > > On Jan 17, 2006, at 5:01 PM, Jack Diederich wrote: > > >On Tue, Jan 17, 2006 at 04:02:43PM -0800, Guido van Rossum wrote: > >>On 1/17/06, Adam Olsen <[EMAIL PROTECTED]> wrote: > >>>>

Re: [Python-Dev] _length_cue()

2006-02-09 Thread Jack Diederich
[Raymond Hettinger] > [Armin Rigo] > > BTW the reason I'm looking at this is that I'm considering adding > > another undocumented internal-use-only method, maybe __getitem_cue__(), > > that would try to guess what the nth item to be returned will be. This > > would allow the repr of some iterators

[Python-Dev] Baffled by PyArg_ParseTupleAndKeywords modification

2006-02-10 Thread Jack Jansen
e the C compiler rightly complains that I'm passing a const object through a non-const parameter). Can anyone enlighten me? -- Jack Jansen, <[EMAIL PROTECTED]>, http://www.cwi.nl/~jack If I can't dance I don't want to be part of your revolution -- Emma Goldman ___

<    1   2