Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 11/6/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > ... > > > > > > Sorry, I meant complexity to the Python user - it won't require him to > > > learn more in order to write programs in Python. > You are right. But that's Python - I think that nobod

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Samuele Pedroni
Noam Raphael wrote: > On 11/5/05, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > >>More generally, I claim that the current behaviour is better than >>*any* alternative. To refute this claim, you would have to come >>up with an alternative first. >> > > The alternative is to drop the __hash__ met

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 11/5/05, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > More generally, I claim that the current behaviour is better than > > *any* alternative. To refute this claim, you would have to come > > up with an alternative first. > > > The alternative is

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Noam Raphael
On 11/5/05, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > More generally, I claim that the current behaviour is better than > *any* alternative. To refute this claim, you would have to come > up with an alternative first. > The alternative is to drop the __hash__ method of user-defined classes (as

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Noam Raphael
On 11/6/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: ... > > > > Sorry, I meant complexity to the Python user - it won't require him to > > learn more in order to write programs in Python. > > Ahh, but it does add complexity. Along with knowing __doc__, __slots__, > __metaclass__, __init__, __new

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > > On 11/5/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > ... > > > 1. It doesn't add complexity, or a new builtin. > > > > It changes default behavior (which I specified as a portion of my > > statement, which you quote. > > > > And you are wrong, it add

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Noam Raphael
On 11/5/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: ... > > 1. It doesn't add complexity, or a new builtin. > > It changes default behavior (which I specified as a portion of my > statement, which you quote. > > And you are wrong, it adds complexity to the implementation of both > class instantia

Re: [Python-Dev] Why should the default hash(x) == id(x)?

2005-11-05 Thread Martin v. Löwis
Noam Raphael wrote: > Is there a reason why the default __hash__ method returns the id of the > objects? You are asking "why" question of the kind which are best answered as "why not". IOW, you are saying that the current behaviour is bad, but you are not proposing any alternative behaviour. Th

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Josiah Carlson
Noam Raphael <[EMAIL PROTECTED]> wrote: > On 11/3/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: > > > To summarize, I think that value-based equality testing would usually > > > be what you want, and currently implementing it is a bit of a pain. > > > > Actually, implementing value-based equality

Re: [Python-Dev] Should the default equality operator compare values instead of identities?

2005-11-05 Thread Noam Raphael
On 11/3/05, Josiah Carlson <[EMAIL PROTECTED]> wrote: ... > > Right, but lists (dicts, tuples, etc.) are defined as containers, and > their comparison operation is defined on their contents. Objects are > not defined as containers in the general case, so defining comparisons > based on their conte

Re: [Python-Dev] PEP 352 Transition Plan

2005-11-05 Thread Guido van Rossum
> [Guido van Rossum] > > > I've made a final pass over PEP 352, mostly fixing the __str__, > > __unicode__ and __repr__ methods to behave more reasonably. I'm all > > for accepting it now. Does anybody see any last-minute show-stopping > > problems with it? [François] > I did not follow the thread

Re: [Python-Dev] PEP 352 Transition Plan

2005-11-05 Thread François Pinard
[Guido van Rossum] > I've made a final pass over PEP 352, mostly fixing the __str__, > __unicode__ and __repr__ methods to behave more reasonably. I'm all > for accepting it now. Does anybody see any last-minute show-stopping > problems with it? I did not follow the thread, so maybe I'm out in

Re: [Python-Dev] Class decorators vs metaclasses

2005-11-05 Thread Eyal Lotem
On 11/5/05, Alex Martelli <[EMAIL PROTECTED]> wrote: > On 11/4/05, Eyal Lotem <[EMAIL PROTECTED]> wrote: > > I have a few claims, some unrelated, and some built on top of each > > other. I would like to hear your responses as to which are > > convincing, which arne't, and why. I think that if thes