Thank you, Larry!
Cheers,
Nick.
--
https://mail.python.org/mailman/listinfo/python-list
e, and also
include a Python 2.4 compatible version. The timeframe for that isn't entirely
clear, though.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skyst
, I'm not sure if that will provide enough of the 'web' side of things.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mai
*Python* will ultimately inherit from either object or
types.ClassType, but extension classes need not do any such thing.
Yet list.sort works with them all, anyway.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED]
for?
Py> class mygen(object):
... def __init__(self, data):
... self.data = data
... def __iter__(self):
... while 1:
... print self.data
... yield None
...
Py> g = mygen(0)
Py> giter = iter(g)
Py> giter.next()
0
Py> g.data = 1
Py> giter.next()
1
Chee
Alan Gauld wrote:
But the bottom line is that there is no builtin command
because the mechanism is different on each platform.
I'd have said it was because the inpreter is line-oriented rather than
screen-oriented, but YMMV.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Bri
def tot_expenses(self, expenses):
self.total_expenses = sum(expenses)
Or, have the function take a variable number of arguments, and do the same
thing:
def tot_expenses(self, *args):
self.total_expenses = sum(args)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Aust
Steven Bethard wrote:
Nick Coghlan: def-from syntax [4]
(def f(a) + o(b) - o(c) from (a, b, c))
(def x * x from (x))
(def x from ())
(def x.bar(*a, **k) from (*a, **k))
((def x(*a, **k) from ()) for x, a, k in funcs_and_args_list)
After a bit more musing, this is definitely my preferred syntax
ata)):
... val_to_pos[x] = i + 1
...
Py> print val_to_pos
{8: 4, 1: 1, 2: 3, 4: 5, 5: 2}
It even works with strings as leaf elements:
Py> data = [["abc","def",2],8,"xyz"]
Py> flatt
dard dictionary interface, and not
something the mixin can derive from the generic container methods.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://
Steven Bethard wrote:
Nick Coghlan wrote:
.keys() is definitely part of the standard dictionary interface, and
not something the mixin can derive from the generic container methods.
Why is that? Isn't keys derivable as:
def keys(self):
return list(self)
if __iter__ is defined?
As yo
builtins to be "removed" in Py3k, I believe the actual intent is
to move them to a module (e.g. sys), with the removal being "remove from the
builtins", not "remove from Python".
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTEC
Andrew Koenig wrote:
duck typing?
That's the Australian pronunciation of "duct taping".
More Kiwi, I'm thinking ;)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
Paul Rubin wrote:
Nick Coghlan <[EMAIL PROTECTED]> writes:
Do you consider generator expressions or list comprehensions deficient
because they don't allow several statements in the body of the for
loop?
I don't see what it would mean to do otherwise.
Exactly the same as a su
expression".
On backticks, they have a major problem in that many fonts make ` and '
virtually indistinguishable. A secondary problem is that printed text often
renders an opening single quote like a backtick. Guido has already mentioned
this in one of Python Regrets talks (in th
r and linked to from the main documentation (rather than from
the sidebar menu on the webpage).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skyst
"About the Python Documentation" link that explains
how to do this.
Compare:
http://www.python.org/doc/2.4/
To:
http://www.python.org/dev/doc/devel/
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
list.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
The script is executed in a process separate from your command shell, and hence
has no effect on your shell's current directory.
There are some things that batch files and shell scripts are still good for -
manipulating the shell :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROT
output of ipconfig instead. Use subprocess
to run the command in Python 2.4, or work something out with one of the popen
variants for earlier versions.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
BJörn Lindqvist wrote:
So I'm asking here if someone
knows a better way, maybe using decorators or metaclasses or other
black magic?
Wait for Python 3k when this will work:
class c:
def __init__(self):
with self:
.x = 1
.y = 2
.hi = "Hi there!"
Cheers,
Nick.
ONHOME and PYTHONPATH because
the docs don't seem to contain a whole lot of info.
I think PYTHONPATH is discussed in the tutorial. PYTHONHOME, I'm not so sure on
(PYTHONPATH and PYTHONSTARTUP are the only two you're likely to care about,
though - and I think the Tutorial covers both of them
hat only allows sorting a
table on one column at a time, you'll appreciate the frustration that can cause :)
Also, it's required to match the behaviour of the Python 2.4 version (which gets
to take advantage of the stability of the builtin sort).
Cheers,
Nick.
--
Nick Coghlan |
enuinely taught them that, you may have done them a disservice:
Py> def f(x):
...print x
...
Py> f1 = f
Py> f2 = lambda x: f(x)
Py> f1("hi")
hi
Py> f2("hi")
hi
Py> def f(x):
... print x * 2
...
Py> f1("hi")
hi
Py> f2("hi&qu
keywords
currently in that category are three letters or less: and, or, is, in, for)
4. People complaining about 2
Oh hell yes, this bugs me. And I think changing the syntax and calling them
"deferred expressions" instead of "lambdas" would go a long way towa
ng a bug report :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
kage
versioning system. Then all module developers would have to do is be aware of
how to use the distutils versioning system, and installing side-by-side versions
of packages would be create straightforward.
Cheers,
Nick.
sure about Python 2.2 and earlier.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
mary of the differences between the old version and the new version (handy if
you can read a context diff, not so handy otherwise).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://bore
Craig Ringer wrote:
Well, that's several hundred more words than were probably required, but
I hope I made sense.
Remarkably similar to what I just posted. . . I guess numeric 2-tuples are just
too good to pass up when discussing sorting :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROT
in
languages where "the compiler knows about types and functions, and the runtime
knows about variables and instances".
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://bore
Stephen Waterbury wrote:
A notable example is Verity's search engine -- see
http://python.oreilly.com/news/PythonSS.pdf
Not to mention the kind words of the current reigning king of the search engine
world. . .
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Aust
anity checks on Python code.
http://pychecker.sourceforge.net/
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
amespaces
instead of bunches. . .
def f(ns1, ns2):
print ns1.a, ns1.b, ns2.a, ns2.b
f(ns1 = namespace(a=1, b=2), ns2 = namespace(a=3, b=4))
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
h
e
dictionaries which could save a *lot* of number crunching (as well as making
otherwise unsortable lists sortable).
So it's a good thing you did decide to send it :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
Roy Smith wrote:
It's actually kind of neat, but boy does it play headgames with me when
I switch back and forth between that and Python.
Switching back and forth betwen C++ and Python plays headgames *anyway* }:>
Cheers,
Nick.
Hardware control with Python is nice. . .
--
Nick
e clause really isn't appropriate for break, continue, import or global
statements, as they don't contain any expressions :)
For compound statements, a where clause probably isn't appropriate, as it would
be rather unclear what the whe
.
Py> c = C()
Py> c.useval(4)
Py> c.x
4
Py> c.usefunc(list)
Py> c.x
[]
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Nick Coghlan wrote:
It also allows the necessary but uninteresting setup for an expression
to be moved "out of the way", bringing the expression that does the real
work to prominence.
Killer app for this keyword:
class C(object):
x = property(get, set) where:
def get(self):
nts of the where clause).
Putting the statement of interest after the where suite still gives the benefits
of avoiding namespace clutter, but doesn't really help readability (it makes it
worse, if you ask me).
Particularly, what if the next statement is a compound statement?
Cheers,
Nick.
_func to
lambda: x when working by value :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
:
-> float( + "." + )
-> getattr(int(), )
-> xrange(, )
However, the problem comes when you realise that 1e3 is also a floating point
literal, as is 1.1e3.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] |
3k.
So let's use it for expression naming in 'if' statements, too.
if someregexp.match(s) as m:
# blah using m
elif someotherregexp.match(s) as m:
# blah using m
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
multi-threaded.
See here for some more info on Python's threading:
http://www.python.org/doc/2.4/api/threads.html
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Bengt Richter wrote:
On Sat, 08 Jan 2005 16:42:16 +1000, Nick Coghlan <[EMAIL PROTECTED]> wrote:
And, is the whole thing after the '=' an expression? E.g.,
x = ( foo(x) where:
x = math.pi/4.0
) where:
def foo(x): print 'just for illustration', x
of how you might do that more than once in a
statement.
I think having to keep the names unique within the statement you are currently
writing is a reasonable request :)
Cheers,
Nick
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
pressions. Here's a version using my preferred syntax
from the AlternateLambdaSyntax page:
if test(something(), (def x < 10 from x)) as m:
print "Case 1:", m
elif test(something(), (def x > 20 from x)) as m:
print "Case 2:", m
ou need to be a little more explicit than simply saying "something goes
wrong".
Exception? Wrong move? What?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlazi
h, even further:
z = C() where:
class C(object):
...
Lets you make anonymous classes and singleton objects.
Here's another nice one if 'where' is added to compound statements as well:
@dbc(pre, post)
def foo():
pass
where:
def pre():
pass
def post(
Paul Rubin wrote:
Nick Coghlan <[EMAIL PROTECTED]> writes:
I think having to keep the names unique within the statement you are
currently writing is a reasonable request :)
Um, you could say the same thing about the function, the module, etc. ;)
And, indeed, that is what Python currentl
nested-if approach that works right now
if I wanted access to part of the condition instead of the whole thing.
However, being able to bind a name to the conditions would be handy for many
cases.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL P
Alex Martelli wrote:
I wonder if 'with', which GvR is already on record as wanting to
introduce in 3.0, might not be overloaded instead.
Perhaps we could steal 'using' from the rejected decorator syntax.
x = [f(x) for x in seq] using:
def f(x):
return x * x
Cheers,
N
;s grammar.
And I don't think we'd actually have to wait for Python 3 for this, we'd just
have to do the __future__ dance in order to introduce the new keyword.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
Paul Rubin wrote:
Nick Coghlan <[EMAIL PROTECTED]> writes:
Trying to push it a level further (down to expressions) would, IMO, be
a lot of effort for something which would hurt readability a lot.
I think we should just try to do things in a simple and general way
and not try to e
Is it actually possible to make it work?
Keyword choice
Should the clause be allowed on any statement (as described), or restricted
to ones where it "makes sense"?
Examples
# Statement local functions (from Andrey Tatarinov)
# aka How to cope if lambda goes away :)
r
ually have a 'bytes' type, but I don't recall
if that was going to be mutable or immutable.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.
Thomas Linden wrote:
How can I tell python to use the compiled in modules and not try to
load them from outside?
http://www.python.org/dev/doc/devel/api/importing.html
Take a look at the last three entries about registering builtin modules.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED
Steve Holden wrote:
Excuse me, these are supposed to be IMPROVEMENTS to Python?
I think it's more messing around before coming to the conclusion that, of the
many things that 'where' helps with, this sure as hell ain't one of them :)
Cheers,
Nick.
--
Nick Coghlan
have to create the extra level of scoping all the time.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
Duncan Booth wrote:
Nick Coghlan wrote:
Grammar Change
--
Current::
statement ::=stmt_list NEWLINE | compound_stmt
New::
statement ::=(stmt_list NEWLINE | compound_stmt) [local_namespace]
local_namespace ::= "with" ":" suite
Semantics
--
Nick Coghlan wrote:
Disallowing local namespaces for statement lists would suggest something
like this:
statement ::= (simple_stmt
(NEWLINE | ";" stmt_list NEWLINE | local_namespace)
) |
(compound_stmt [local_namespace])
local
nt of work went into making the Windows implementation of that module
as solid as the *nix implementation, whereas there may still be issues with
direct os.popen calls (as Roel's investigation suggests).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane,
9 hits CVS (with functional.partial), maybe it can grow aliases
for the three of them so people can get used to the idea.
It might keep partial from getting too lonely. . . :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Bri
. This let deque sacrifice some of list's flexibility
in favour of increased speed.
Appropriate parts of the core which needed a FIFO were then updated to use the
new data type, while everything else continues to use lists.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Bri
Nick Coghlan wrote:
Semantics
-
The code::
with:
translates to::
def unique_name():
unique_name()
Bleh. Not only was my proposed grammar change wrong, my suggested semantics are
wrong, too.
Raise your hand if you can see the problem with applying the above semantics to
Nick Coghlan wrote:
Nick Coghlan wrote:
Semantics
-
The code::
with:
translates to::
def unique_name():
unique_name()
Bleh. Not only was my proposed grammar change wrong, my suggested
semantics are wrong, too.
Raise your hand if you can see the problem with applying the
and adding our suite-definitions there.
A new scope essentially *is* a nested function :)
My main purpose with the nested function equivalent is just to make the intended
semantics clear - whether an implementation actually _does_ things that way is
immaterial.
Cheers,
Nick.
--
Nick Coghlan
o far ('where', 'with', 'in', 'using'), I'd
currently vote for 'using' with 'where' a fairly close second. My vote goes to
'using' because it has a fairly clear meaning ('execute the statement using this
extra information
ldn't help much. (The out-of-order execution is what really
makes the property definition example pretty, IMO)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlazine
e document was removed. Who knows what happened?
>
> Does anyone here have a copy of that document? Or who can tell me what is the
> email address of Jim Jackson or Kar-Han Tan.
http://web.archive.org/web/2003101953/http://wiki.cs.uiuc.edu/cs427/PYTHON
Cheers,
Nick.
--
. . just that it
works :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ype(protocol, Abstract):
raise LiskovViolation
# etc
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
run.
Has common.py been reload()'ed at some point? Then previously imported modules
may still have names bound to the old instances.
And so forth.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
nt i to be "i-2" if i%2 is not equal to 0?
Hmm:
z = [newval(i) for i in range(10)] using:
def newval(x):
if x % 2:
return x - 2
else:
return x + 2
Just some more mental twiddling relating to the thread on statement local
namespaces.
Chee
Nick Coghlan wrote:
Semantics
-
The code::
with:
translates to::
def unique_name():
unique_name()
I've come to the conclusion that these semantics aren't what I would expect from
the construct. Exactly what I would expect can't really be expressed in current
e said the point was both :)
But yeah, unfortunately the 'leaking list comp' problem won't be fixed in the
2.x series due to the compatibility problem. Fortunately, generator expressions
didn't inherit the issue.
Cheers,
Nick.
--
Nick Coghlan |
f pre():
pass
def post():
pass
# Singleton classes
as C:
C = _C()
using:
class _C:
pass
# Complex default values
as f:
def f(x=default()):
pass
using:
def default():
return "Demo default"
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
into a context which doesn't care in the slightest?
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
est.__init__ function.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ement. Actually appending
either of those tokens means the string is no longer an expression.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.pyt
Nick Coghlan wrote:
as equivalent to:
def __use_stmt():
def _in_clause():
return
return _in_clause()
__use_stmt_args = {}
= __use_stmt()
del __use_stmt
The more I think about this return-based approach, the less I like it. It could
probably be made to work, but it just feels
neophyte wrote:
Nick Coghlan wrote:
> Is
> this something to do with system modules being singletons?
They aren't singletons in the GoF design pattern sense. However,
Python's import
machinery operates in such a way that it takes effort to get multiple
version of
the same module in
g koans don't really cover the
concept.
Its addition also seems fitting in light of the current PEP 246 discussion which
is *all* about playing well with others :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
-
best you can do for an in-place version:
for i, x in enumerate(reversed(lst)):
if x == 2:
del lst[-i]
The effbot's version is still going to be faster though:
lst = [x for x in lst if x != 2]
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTEC
times, I now make sure to release the GIL as part of my SWIG wrapper
(since the code I'm wrapping knows nothing of Python, and sure as heck doesn't
need to be holding the GIL!).
Cheers,
Nick.
--
Nick Coghlan | [EMAIL
John Machin wrote:
Nick Coghlan wrote:
The effbot's version is still going to be faster though:
lst = [x for x in lst if x != 2]
Have you measured this?
Nope. I'm going purely on the fact that it is O(n), and the in-place
modification will always be worse than that.
Cheers,
Nic
rrently the case. There's a similar performance
glitch associated with constructing a tuple from a generator expression (with
vanilla 2.4, detouring via list is actually faster)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROT
* the solution for most
such cases where the standard Python rule doesn't apply :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
... """
Py> main()
hello1
hello2
'exec' is quite happy to deal with newlines and indenting.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ame[, default]) -> value
Get a named attribute from an object; getattr(x, 'y') is equivalent to x.y.
When a default argument is given, it is returned when the attribute doesn't
exist; without it, an exception is raised in that case.
Cheers,
Nick.
--
Nick Coghlan
ython] mailing list tag, so automatic
filtering isn't that difficult. It is an unfortunate shame that his
consideration doesn't extend to removing the general Perl and Python discussion
groups from his recipients list.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Bris
the type check.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
d. This is what PyGILState_Ensure and PyGILState_Release are
for - so C code can leave the GIL unlocked by default, and only grab it when
they want to call into the C/Python API.
Regards,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Bris
ven
when the source *doesn't* mutate, though. I'll have to think some more to see if
I can come up with any concrete ideas for you to shoot down :)
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
that PEP 311 (which added these
functions) went in.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
ptions are rare, and not worth
worrying about at that point in their learning.
Only when one is aware of the reasons for a principle, can one be aware of good
reasons not to follow it :)
Cheers,
Nick.
--
Nick Coghlan | [EM
le keys acquire
the requisite immutability is going to be application dependent.
Provision of a safe_dict or identity_dict would merely allow a programmer to
state their intent at the time the container is created, rather than having to
state it whenever keys
l be making copies all the time.
Alternatively, the class could declare itself to work reliably only with
immutable objects. Performance will improve, since copies need only be made when
an object *actually* changes (and the old immutable copy is deleted and the new
version inserted in its p
limit is platform dependent, but something
around 1000 sounds fairly normal.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---
http://boredomandlaziness.skystorm.net
--
http://mail.python.org/mailman/listinfo/python-list
David Eppstein wrote:
Yes, and what should the following do?
lst1 = [1]
lst2 = [2]
dct = {lst1: "1", lst2: "2"}
lst2[0]=1
lst1[0]=2
print dct[[1]]
print dct[[2]]
Provide yet another example for why mutable keys are almost guaranteed to result
in suprising semantics :)
C
1 - 100 of 435 matches
Mail list logo