Re: [Python-Dev] PEP 351, the freeze protocol

2005-10-26 Thread Paolino
Paolino wrote: Is __hash__=id inside a class enough to use a set (sets.Set before 2.5) derived class instance as a key to a mapping? It is __hash__=lambda self:id(self) that is terribly slow ,it needs a faster way to state that to let them be useful as key to mapping as all set operations

Re: [Python-Dev] PEP 351, the freeze protocol

2005-10-24 Thread Paolino
I'm not sure I understood completely the idea but deriving freeze function from hash gives hash a wider importance. Is __hash__=id inside a class enough to use a set (sets.Set before 2.5) derived class instance as a key to a mapping? Sure I missed the point. Regards Paolino

[Python-Dev] Trasvesal thought on syntax features

2005-09-26 Thread Paolino
. Paolino ___ 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] Replacement for print in Python 3.0

2005-09-03 Thread Paolino
)), iter=1) f(1,[2,3],(_ for _ in (4,5)),iter=True) Regards Paolino ___ 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

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

2005-09-03 Thread Paolino
makes it a non compatible solution with the rest of yours. writeln('def', (5, 6)) Regards Paolino ___ Python-Dev mailing list Python-Dev@python.org http://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http://mail.python.org/mailman

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

2005-09-02 Thread Paolino
Jack Diederich wrote: 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

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

2005-09-02 Thread Paolino
Christos Georgiou wrote: Paolino [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] What if I want to chain an infinite list of iterables? Shouldn't itertools.chain be built to handle that? Raymond already suggested a four-line function that does exactly that. Create your

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

2005-09-01 Thread Paolino
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 this signature ? Regards paolino

Re: [Python-Dev] On decorators implementation

2005-08-22 Thread Paolino
Paolino wrote: I noticed (via using them) that decorations are applied to methods before they become methods. This choice flattens down the implementation to no differentiating methods from functions. 1) I have to apply euristics on the wrapped function type when I use the function

[Python-Dev] On decorators implementation

2005-08-21 Thread Paolino
ends up in metamethods or something I can't grasp Thanks Paolino ___ 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

[Python-Dev] set.remove feature/bug

2005-08-12 Thread Paolino
for ever. Or if there is a workaround, please tell me here because python-list didn't help. class H(set): def __hash__(self):return id(self) s=H() f=set() f.add(s) f.remove(s) # this fails Regards Paolino ___ Python-Dev mailing list Python-Dev

[Python-Dev] is type a usable feature?

2005-06-23 Thread Paolino
Hello developers,I noticed my application was growing strangely while I was using type, then I tried this: while True: type('A',(),{}) and saw memory filling up.Is there a clean solution to that? I see it as a bug in python engeneering,that is why I wrote to you. Thanks a lot Paolino

Re: [Python-Dev] is type a usable feature?

2005-06-23 Thread Paolino
Tim Peters wrote: [Paolino [EMAIL PROTECTED]] Hello developers,I noticed my application was growing strangely while I was using type, then I tried this: while True: type('A',(),{}) and saw memory filling up.Is there a clean solution to that? I see it as a bug in python engeneering

Re: [Python-Dev] is type a usable feature?

2005-06-23 Thread Paolino
Tim Peters wrote: [Paolino [EMAIL PROTECTED]] Hello developers,I noticed my application was growing strangely while I was using type, then I tried this: while True: type('A',(),{}) and saw memory filling up.Is there a clean solution to that? I see it as a bug in python engeneering