Re: General question about Python design goals

2005-12-02 Thread Mike Meyer
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

Re: Death to tuples!

2005-12-01 Thread Mike Meyer
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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
[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

Re: General question about Python design goals

2005-12-01 Thread Mike Meyer
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

Re: python speed

2005-12-01 Thread Mike Meyer
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

Re: HTML parsing/scraping python

2005-12-01 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-12-01 Thread Mike Meyer
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

Re: Automate webpage refresh

2005-12-01 Thread Mike Meyer
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

Re: General question about Python design goals

2005-12-01 Thread Mike Meyer
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__

Re: Death to tuples!

2005-12-01 Thread Mike Meyer
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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
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

Re: Instances behaviour

2005-12-01 Thread Mike Meyer
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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
[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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
[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

Re: Making immutable instances

2005-12-01 Thread Mike Meyer
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

Re: General question about Python design goals

2005-11-30 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-30 Thread Mike Meyer
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

Re: python speed

2005-11-30 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[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

Re: HTML parsing/scraping python

2005-11-30 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
[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

Re: Making immutable instances

2005-11-30 Thread Mike Meyer
. 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

Re: General question about Python design goals

2005-11-30 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-29 Thread Mike Meyer
, 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

Re: Death to tuples!

2005-11-29 Thread Mike Meyer
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

Re: Which License Should I Use?

2005-11-29 Thread Mike Meyer
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

Re: ncurses' Dark Devilry

2005-11-29 Thread Mike Meyer
-- 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

Re: Making immutable instances

2005-11-29 Thread Mike Meyer
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

Re: General question about Python design goals

2005-11-29 Thread Mike Meyer
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

Re: type of form field

2005-11-28 Thread Mike Meyer
, 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

Re: return in loop for ?

2005-11-28 Thread Mike Meyer
, 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

Re: Precision for equality of two floats?

2005-11-28 Thread Mike Meyer
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

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
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

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-28 Thread Mike Meyer
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

Re: Death to tuples!

2005-11-28 Thread Mike Meyer
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

Re: return in loop for ?

2005-11-28 Thread Mike Meyer
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

Re: return in loop for ?

2005-11-28 Thread Mike Meyer
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

Re: General question about Python design goals

2005-11-28 Thread Mike Meyer
. 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

Re: New docs for set elements/dictionary keys

2005-11-28 Thread Mike Meyer
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

Re: General question about Python design goals

2005-11-28 Thread Mike Meyer
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

Re: Which License Should I Use?

2005-11-27 Thread Mike Meyer
. 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

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Mike Meyer
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

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Mike Meyer
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

Re: New docs for set elements/dictionary keys

2005-11-27 Thread Mike Meyer
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

Death to tuples!

2005-11-27 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-26 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-26 Thread Mike Meyer
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

Re: Which License Should I Use?

2005-11-26 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-26 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-26 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
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

New docs for set elements/dictionary keys (Was: Why is dictionary.keys() a list and not a set?)

2005-11-26 Thread Mike Meyer
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

Re: CGI question

2005-11-26 Thread Mike Meyer
. 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

Re: Nested list comprehensions

2005-11-26 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-26 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread Mike Meyer
. 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

Re: Python as Guido Intended

2005-11-25 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-25 Thread Mike Meyer
, 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

Re: Making immutable instances

2005-11-25 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-25 Thread Mike Meyer
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

Re: Which License Should I Use?

2005-11-25 Thread Mike Meyer
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

Re: Which license should I use?

2005-11-25 Thread Mike Meyer
[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

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-25 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-25 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-25 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-25 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
-- 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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
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

Re: return in loop for ?

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
[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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
(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

Re: Python as Guido Intended

2005-11-24 Thread Mike Meyer
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

Re: return in loop for ?

2005-11-24 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
-- 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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
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

Re: Python as Guido Intended

2005-11-24 Thread Mike Meyer
[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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
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

Re: wxPython Licence vs GPL

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: Making immutable instances

2005-11-24 Thread Mike Meyer
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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
. 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

Re: Why is dictionary.keys() a list and not a set?

2005-11-24 Thread Mike Meyer
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

Re: What a curious assignment.

2005-11-23 Thread Mike Meyer
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

<    1   2   3   4   5   6   7   8   9   10   >