Donn Cave [EMAIL PROTECTED] writes:
In article [EMAIL PROTECTED], Mike Meyer [EMAIL PROTECTED]
wrote:
Seriously. Why doesn't this have to be phrased as for x in list((1,
2, 3)), just like you have to write list((1, 2, 3)).count(1), etc.?
How could list(t) work, if for x in t didn't?
Good
at definition
time if it were as you suggested?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
Mike Meyer wrote:
[EMAIL PROTECTED] writes:
Quoting the frequently used term Practicality beats purity. If I have
a practical problem/needs now and it solves it, why not use it ?
In other words, you have a use case. Cool. Please tell us what it is -
at least
Fredrik Lundh [EMAIL PROTECTED] writes:
Mike Meyer wrote:
So why the $*@ (please excuse my Perl) does for x in 1, 2, 3 work?
because the syntax says so:
http://docs.python.org/ref/for.html
In other words, Because that's the way we do things.
Seriously. Why doesn't this have
Fredrik Lundh [EMAIL PROTECTED] writes:
Mike Meyer wrote:
If you wire everything down, you can always hand-code assembler that
will be faster than HLL code
but that doesn't mean that your hand-coded assembler will always be faster
than an HLL implementation that addresses the same problem
to go back in
history?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
someone else to do it for you. If
you expect people to do work for you gratis on a regular basis, I'm
afraid you're in for a lot of dissapointment.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email
code should look like this:
# Untested - I don't have Konquer installed.
import webbrowser
webbrowser.open(url1)
You may have to set the BROWSER environment variable to get it to find
Konquerer.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm
Fredrik Lundh [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Seriously. Why doesn't this have to be phrased as for x in list((1,
2, 3)), just like you have to write list((1, 2, 3)).count(1), etc.?
because anything that supports [] can be iterated over.
That's false. Anything that has __getitem__
Antoon Pardon [EMAIL PROTECTED] writes:
On 2005-12-01, Mike Meyer [EMAIL PROTECTED] wrote:
Antoon Pardon [EMAIL PROTECTED] writes:
I know what happens, I would like to know, why they made this choice.
One could argue that the expression for the default argument belongs
to the code
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
Lots of people seem to want immutable instances. Nobody seems to have
a use case for them.
What is the use case for immutable strings? Why shouldn't strings be
mutable like they are in Scheme?
I don't know. Why
Ben Finney [EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] wrote:
Lots of people seem to want immutable instances. Nobody seems to
have a use case for them.
Perhaps you missed my release announcement of the 'enum' package that
explains why Enum instances are immutable.
Yes, I did. I
method that B
C's __init__ can invoke.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
[EMAIL PROTECTED] writes:
Mike Meyer wrote:
That's not a use case, that's a debugging aid. The same logic applies
to adding type declarations, private/public/etc. declerations, and
similar BD language features. It's generally considered that it's not
a good enough reason for adding those, so
year. It doesn't justify making the instances
immutable. Or if it does, I missed it.
thanks,
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org
[EMAIL PROTECTED] writes:
Mike Meyer wrote:
By design, this is a don't use feature so it would be very hard to
find a use case ;-)
But I can think of use cases for instances with no mutable attributes,
which is another don't use case. If I can do that, those proposing
that instances ought
Ben Finney [EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] wrote:
Ben Finney [EMAIL PROTECTED] writes:
Since the values of an enumeration are directly reflected in
the values and attributes, Enum instances are immutable to
preserve this relationship
This justifies
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
An awful lot of the time in this newsgroup, practicality beats
purity translates as the programmer can just be a lazy slob.
You post that as if it were a bad thing.
Yes. The idea of using a program
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
Letting the class author declare whether or not the client can add
attributes is wrong for the same reasons - and in the same places -
that letting the class author declare that the client shouldn't be
allowed
practicality beats purity.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Antoon Pardon [EMAIL PROTECTED] writes:
On 2005-11-29, Mike Meyer [EMAIL PROTECTED] wrote:
Antoon Pardon [EMAIL PROTECTED] writes:
You see, you can make languages more powerful by *removing* things
from it.
You cast this in way to general terms. The logic conclusion
from this statements
the compiler won't). But things don't stay wired down - the CPU
gets upgraded, caches change size, pages change size, the data gets
bigger, etc. Hand-tuned code doesn't deal well with such, whereas
generated code can be made to do just that.
mike
--
Mike Meyer [EMAIL PROTECTED
[EMAIL PROTECTED] writes:
Mike Meyer wrote:
[EMAIL PROTECTED] writes:
I am puzzled, and could have read what you want wrong. Are you saying
you want something like this :
a={}
a.something = I want to hang my stuff here, outside the intended use
of dict
Exactly. For a use case
Perl vs. Python?
Why Python?
Because it's beautiful. Seriously, Python code is very readable, by
design. Of course, some of the features that make that happen drive
some people crazy. If you're one of them, then Python isn't the
language for you.
mike
--
Mike Meyer [EMAIL PROTECTED
someone else will use
it don't matter.
I take it you never distribute your code, or otherwise expect other
people to reuse it?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information
[EMAIL PROTECTED] writes:
Mike Meyer wrote:
[EMAIL PROTECTED] writes:
Well, in this case, would it be simple for the OP that if he wants to
disallow this attaching additional things, just use __slot__.
That's *documented* as an implementation-dependent behavior. Using it
to get that effect
.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
this have to be phrased as for x in list((1,
2, 3)), just like you have to write list((1, 2, 3)).count(1), etc.?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http
, pointing out
that something is bad is *not* a waste of their time, as it protects
something good. So basically, you're asking that people waste their
time on something of dubious value. Not a request that's likely to be
get very far.
mike
--
Mike Meyer [EMAIL PROTECTED] http
with the same restrictions as tuples.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Andrew Koenig [EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Definitely not. The most recent change to the copyright laws made
works of music recorded to fullfill a contract work for hire by
default.
If there's a contract -- i.e., a written
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
When it was suggested that a facility for doing this be added to the
language, I asked for a use case for it. Nobodies come up with a
reason for placing such restriction on the client yet. If you've got a
use
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
But a programming language (or UI) is not just a collection of syntax
and and interfaces - it's an implementation. You need to keep in mind
that practicality beats purity.
An awful lot of the time
, and then pickle that and
store the results in a hidden element. Or - well, I'm sure you get the
idea.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org
,
and it is always correct in doing so? Note that I don't know could
be I ran longer than I think is reasonable and gave up trying.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http
about this; there's
probably a better version).
DSepending on why you need it, you might consider using decimals
(introduced in 2.4) instead of floats.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant
Steven Bethard [EMAIL PROTECTED] writes:
Dan Bishop wrote:
Mike Meyer wrote:
Is there any place in the language that still requires tuples instead
of sequences, except for use as dictionary keys?
The % operator for strings. And in argument lists.
def __setitem__(self, (row, column), value
Peter Hansen [EMAIL PROTECTED] writes:
Mike Meyer wrote:
It seems that the distinction between tuples and lists has slowly been
fading away. What we call tuple unpacking works fine with lists on
either side of the assignment, and iterators on the values side. IIRC,
apply used to require
Antoon Pardon [EMAIL PROTECTED] writes:
Op 2005-11-25, Mike Meyer schreef [EMAIL PROTECTED]:
Antoon Pardon [EMAIL PROTECTED] writes:
Well this is, is one thing I have a problem with.
The python people seem to be more concerned with fighting things
that could be used counter the python
is a messy question.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
Which means you can't create a verifier which will verify all
programs. Is there a reason to believe that you can't have a verifier
with three possible outcomes: Correct, Incorrect, and I don't know
the programs (or their type validation) to fail
to terminate.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
. You need to keep in mind
that practicality beats purity. If following POLA makes the
implementation an order of magnitude slower or larger, then you don't
follow POLA - at least until you can do it without that cost.
mike
--
Mike Meyer [EMAIL PROTECTED] http
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Christoph Zwerschke wrote:
I think that is not so bad. How about this simplification:
Any hashable object(1) can be used as a dictionary key/set
element. Lists, sets and dicts are not hashable, and can not be
used. Tuples can
doesn't consign your suggestions to oblivion.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
.
Definitely not. The most recent change to the copyright laws made
works of music recorded to fullfill a contract work for hire by
default.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more
Martin v. Löwis [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Personally, I think we'd be better off to come up with a term for this
property that doesn't have a commonly understood meaning that has such
broad areas of disagreement with the property. I've been using
hashable, which I would
or an __eq__
method can be used even if they don't have a __hash__ method.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Any object for which hash() returns an appropriate value(1) can be
used as a dictionary key/set element. Lists, sets and dicts are not
hashable, and can not be used. Tuples can be used if all the things
they contain are hashable
frozenlist
could be done now. Whehter or not we could make tuple an alias for
frozenlist before Py3K is an interesting question.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information
people fewer,
weaker rights than you got
That's a restriction on redistribution.
I would still like to find out what sense of restricting distribution
you think the GPL does.
You named the restrictions yourself.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
Those two statements say the same thing. Part of the Python philosphy,
from import this, is that there should only be one obvious way to do
it. By enabling that part of Python's philosphy, you're automatically
Steven D'Aprano [EMAIL PROTECTED] writes:
On Fri, 25 Nov 2005 23:20:05 -0500, Mike Meyer wrote:
If you've got a use case, I'd be interested in hearing it.
frozenset perhaps? If it were needed once, it could be needed again.
That's not a use case, that's an example. And not a very good one
to convince
you they can do that.
But this cuts both ways - if you get them to agree in writing as part
of the employment agreement that the code isn't there, which Steve
suggested, then laws about work for hire are pretty much
irrelevant.
mike
--
Mike Meyer [EMAIL PROTECTED
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer wrote:
I think you're trying to tweak the wrong definition. Types are
immutable if their instances are immutable.
I'm not trying to tweak it, but to gain more clarity about what is
actually meant when you talk about mutable types
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 26 Nov 2005 04:59:59 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
On Fri, 25 Nov 2005 23:20:05 -0500, Mike Meyer wrote:
If you've got a use case, I'd be interested in hearing it.
frozenset perhaps? If it were needed once
Martin v. Löwis [EMAIL PROTECTED] writes:
Mike Meyer wrote:
class mylist1(list):
def __hash__(self): return 0815
class mylist2(list):
def __hash__(self): return id(self)
In the case of mylist1, everything is ok including semantics, but
performance suffers dramatically. In mylist2
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 26 Nov 2005 04:46:15 -0500, Mike Meyer wrote:
Steven D'Aprano [EMAIL PROTECTED] writes:
But if you *do* redistribute it, then you must live up to conditions in
the licence. If you aren't willing to do that, use software with a
different
Martin v. Löwis [EMAIL PROTECTED] writes:
Mike Meyer wrote:
This is not true. The second definition of __hash__ does not meet
the specifications:
The specification isn't on the __hash__ method, but on objects.
What does it mean for a specification to be on something? The
specification I quoted
. Maybe if you told us
where it came from, we could recommend a module for dealing with such.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman
in the opposite order.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Steven D'Aprano [EMAIL PROTECTED] writes:
On Sat, 26 Nov 2005 18:18:44 -0500, Mike Meyer wrote:
So that's the basis of the disagreement. I'm using restriction with
the intent of communicating it's normal english meaning,
Your meaning is about as far from the plain English sense of restrictive
.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Antoon Pardon [EMAIL PROTECTED] writes:
Op 2005-11-24, Mike Meyer schreef [EMAIL PROTECTED]:
Antoon Pardon [EMAIL PROTECTED] writes:
The usual response is That's not the Python way. That's not calling
someone dumb, just pointing out that they don't yet fully understand
the Python way
,
from import this, is that there should only be one obvious way to do
it. By enabling that part of Python's philosphy, you're automatically
limiting python to not allow other - specifically non-pythonic - ways
to do the same thing.
mike
--
Mike Meyer [EMAIL PROTECTED] http
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
There isn't a standard serialize method in Python, so I don't know how
you want to define it.
I can think of perfectly reasonable definitions
of serialize where obj.serialize() won't always return the same string
of parallel communities, instead of
everyone working on/with the same project.
How are the proprietary forks any worse/more dangerous than the
open implementations of Python when it comes to such things? In other
words, what does the GPL do that prevents this forking?
mike
--
Mike Meyer [EMAIL
that best meets your
description are the BSD-like license, which have been called
copycenter licenses. They place no restrictions whatsoever on the
the further use.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix
[EMAIL PROTECTED] (Björn Lindström) writes:
Mike Meyer [EMAIL PROTECTED] writes:
IANAL, but I don't believe the GPL helps in this situation. It places
conditions on redistributing the code; it doesn't force you to
redistribute modifieed code. Your employers could refuse to let you
take
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer schrieb:
Ok, how about this for dictionaries/sets:
Any hashable object can be used as a dictionary key (set
member). Immutable
objects, except for tuples that contain a non-hashable object, are
hashable. Python classes are normally
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer wrote:
The mutability - or immutability - of an object is irrelevant to
the question of whether or not they can be a dictionary key/set
element. The critical property is that they are hashable.
*Most* immutable builtin types
Steven D'Aprano [EMAIL PROTECTED] writes:
On Thu, 24 Nov 2005 11:44:16 -0500, Mike Meyer wrote:
In Python, I can even fix
it so *your* code uses my wrapped version:
import Finney
class Addable(Finnney.Immutable): pass
Finney.Immutable = Addable
Python's consenting adults philosophy
Steven D'Aprano [EMAIL PROTECTED] writes:
On Thu, 24 Nov 2005 16:00:29 -0500, Mike Meyer wrote:
The GPL doesn't restrict distribution. I don't understand where
people get this bizarre view of the GPL from.
It happens because people say things like:
If you don't like that clause, you have two
for placing such restriction on the client yet. If you've got a
use case, I'd be interested in hearing it.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
Giovanni Bajo [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Note that this property of __slots__ is an implementation detail. You
can't rely on it working in the future.
I don't rely on it. I just want to catch bugs in my code.
I certainly hope you're not relying on it to catch bugs. You should
availability would imply that
other-licensed software has a tendency to become unavailable. Do you
know of any examples of such?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http
in range(20) if j = 10]:
inloop()
if not (i 10):
afterloop()
return
At this point, the argument collapses in a cloud of impracticality,
and we go back to returning from wherever we want to.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home
[EMAIL PROTECTED] [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Giovanni Bajo [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Note that this property of __slots__ is an implementation detail. You
can't rely on it working in the future.
I don't rely on it. I just want to catch bugs in my code
(Finnney.Immutable): pass
Finney.Immutable = Addable
Which means that from now on *your* code that tries to create
Immutables will actually get Addables. The inability to do this in BD
languages is - well, painfull. That Python doesns't require the
boilerplate in a good thing.
mike
--
Mike Meyer [EMAIL
rather than in Python to allow me to get it fixed.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
the exception back up the chain. I'm not sure that it stacks up
on the practicality scale, but it certainly leads to a more
comprehensible program when you are dealing with lots of exceptions.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
of those IPs obviously felt
that the ability to restrict distribution in some way was needed to
make the effort of developing and distributing the software in the
first place worthwhile.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW
Christoph Zwerschke [EMAIL PROTECTED] writes:
- Because sets can only contain immutable values
Mike Meyer wrote:
Not true. Sets can only contain *hashable* objects, which isn't the
same thing.
I trusted the doco which defines a set as an unordered collection of
immutable values (http
and doing the distribution.
Personally, I release stuff under a BSD-like license, historically
having included requirements that I be notified of bug fixes, and/or
that I be given copies of commercial software that included my code. I
eventually gave up on them as unenforceable.
mike
--
Mike
Christoph Zwerschke [EMAIL PROTECTED] writes:
Mike Meyer schrieb:
If the hash changes, you've screwed up the set. What it really should
say is collection of objects with fixed hashes, or words to that
effect. Do you want to file a PR on this?
I fear I have not enough understanding of Python's
[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
[EMAIL PROTECTED] writes:
Different programming styles are appropriate for different
tasks, different times and different places, different people.
And like morality, government, or economics, I do not believe
that one style
Martin v. Löwis [EMAIL PROTECTED] writes:
Mike Meyer wrote:
I trusted the doco which defines a set as an unordered collection of
immutable values (http://docs.python.org/lib/types-set.html).
If the hash changes, you've screwed up the set. What it really should
say is collection of objects
Martin P. Hellwig [EMAIL PROTECTED] writes:
Mike Meyer wrote:
cut
Well, they chose to make it available to others for reuse. But
software unavailable to those who can't afford it is better than no
software at all
That I do not agree with, I think it depends on which your side of the
fence
Paul Rubin http://[EMAIL PROTECTED] writes:
Mike Meyer [EMAIL PROTECTED] writes:
On the other hand, so long as the price is lower than the cost of
recreating the software for someone, then it's better for society as
a whole if it exists at all.
I don't think that's correct. Having nothing
Giovanni Bajo [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Note that this property of __slots__ is an implementation detail.
You
can't rely on it working in the future.
I don't rely on it. I just want to catch bugs in my code.
I certainly hope you're not relying on it to catch bugs. You
Giovanni Bajo [EMAIL PROTECTED] writes:
Björn Lindström wrote:
Why do you think we have a frozenset, for instance? By Mike's argument, we
shouldn't have it.
Not *my* arguments, certainly. Not unless you're seriously
misinterpreting them.
mike
--
Mike Meyer [EMAIL PROTECTED
Giovanni Bajo [EMAIL PROTECTED] writes:
Mike Meyer wrote:
And I have no problems with that. If you believe your class should
throw an error if someone calls an instances pop() method when it's
empty, do so.
Likewise, if you want to make it so a client can't change your
attributes, feel free
there, and
extend serialize to include it. Whether or not that's reasonable
depends on how you want to define serialize.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information
Giovanni Bajo [EMAIL PROTECTED] writes:
Mike Meyer wrote:
Björn Lindström wrote:
Why do you think we have a frozenset, for instance? By Mike's
argument, we shouldn't have it.
Not *my* arguments, certainly. Not unless you're seriously
misinterpreting them.
Sorry then, I probably am
.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
--
http://mail.python.org/mailman/listinfo/python-list
comparison and __hash__ should define them so that two
objects that have the same hash compare equal, otherwise using them as
dictionary keys (set elements) will not have the expected behavior.
What do the rest of you think?
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org
important is that in many languages you can't dynamically
add attributes to an object. So an attempt to bind a.i will either
fail, or be an assignment to A.i.
mike
--
Mike Meyer [EMAIL PROTECTED] http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant
301 - 400 of 1231 matches
Mail list logo