Felix Collins wrote:
> Hi,
> I'm not a regexp expert and had a bit of trouble with the following search.
> I have an "outline number" system like
> 1
> 1.2
> 1.2.3
> I want to parse an outline number and return the parent.
Seems to me regex is not the way to go:
def parent(string):
(a FAT drive) might naturally be str, while C:
(an NTFS drive) might naturally be unicode. Even worse, would be a
path that switches in the middle (which it might do if we get to a
ZIP file or use the newer dir-in-file file systems.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mai
is last should be:
>>>''.join(map(chr, (0x73, 0x70, 0x61, 0x6D)))
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
example, you could also define the methods like:
class MyEditClass(MyClass):
def __repr__(self):
return "I, %s, am being edited" % MyClass.__repr__(self)
When to use super rather than direct access to the superclass is an
involved discussion.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
super (A, self) .__init__ ()
print ''
class B (object):
def __init__ (self):
print '',
super (B, self) .__init__ ()
print ''
class C (A, B):
def __init__ (self):
y
then, wherever your python scripts use MY_XYZ, you begin the script
with "import MY" and change every "MY_XYZ" to "MY.XYZ".
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Jerry He wrote:
> ... Is there some way to define [examine] so I can call it like
> examine "string"
> instead of examine("string")?
Perhaps you are looking for ipython (google for it) if
all you are looking for is ease of interactive entry.
mode4l_000.py with the moral equivalent of
from MCMC import LikelihoodError
then this is what is going wrong.
By the way, if it were I, I'd:raise LikelihoodError(p) just so I
could discover a bit of what went wrong.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
return itertools.izip(*seqs)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
nction until the second with is encountered. Then
you need to backtrack to the shift and convert it to a pair of
less-thans before you can successfully translate it.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
'1.12', '1.1', '3.1']
decorated = [(numparts(txt), txt) for txt in lst]
decorated.sort()
lst[:] = [txt for code, txt in decorated]
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Delaney, Timothy (Tim) wrote:
> Scott David Daniels wrote:
>>For 2.3: (using DSU -- Decorate, Sort, Undecorate)
...
>> lst = ['1', '1.2', '1.12', '1.1', '3.1']
>> decorated = [(numparts(txt), txt) for tx
tor technique to get to some (but not
necessarily all) of the attributes. Think of this technique as a
hack to get to a goal, rather than a good technique to use; good for
debugging, not so nice for production work. If you still don't know
how to do this from this admittedly sketchy description,
t; That sounds pretty unlikely. Are you 100% sure you're looking
> at the correct bytes?
Perhaps the one bit is an exponent -- some kind of floating point
based format? That matches the doubling of all digits.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
while len(stack) and not (root.startswith(stack[-1]) and
root[len(stack[-1])] == os.path.sep):
stack.pop()
stack.append(root)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
= sorted(mydict.items())
as in:
For key, value in sorted(mydict.items()):
print '%s -> %r' % (key, value)
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
lare "global varname" inside the function or method in
which you do the writing. Simply using (reading) a global in a module
does not require the "global" declaration.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
parameter style
your DB interface supports, you may use at least one of:
cursor.execute("INSERT INTO TABLENAME(AH, BH) VALUES(?, ?)",
[(holder['str_name'], holder['int_name'])])
or
cursor.execute("INSERT INTO TABLENAME(AH, BH)
;)
<< endl;
The python equivalent:
exec "def area(length,width): return length*width"
exec "def frac(x): return abs(abs(x) - int(abs(x)))"
exec "def test(): return 5"
exec "def abc(x, y=10): return x + y"
exec &
Max Erickson wrote:
> Scott David Daniels <[EMAIL PROTECTED]> wrote in
> news:[EMAIL PROTECTED]:
>
>
>>max wrote:
>> From the web page referenced:
>> ...
>> cout << ucEval("abc(5)-abc(3,4)*(#b01101 shl 1)")
>> <
John Machin wrote:
> Scott David Daniels wrote:
>> max wrote:
>>> Larry Bates <[EMAIL PROTECTED]> wrote in
>> The python equivalent:
>> ...
>> exec "def shl(x, y): return x * 2^y"
>
> Perhaps this should be:
> exec "def
antage of this two-step
approach, but the DB interface is designed to allow it, so
the parameterization is constrained.
See if something like this works:
sql = 'select * from %s where cusid like ? ' % name
Cursor.execute(sql, (recID,))
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
count;
...
PyObject* num = Py_BuildValue("i", 10);
precount = num.ob_refcnt;
PyList_Append(list, num);
...
If you need to do the DECREF, precount should exceed num.ob_refcnt.
If they match, the "PyList_Append" call "stole&qu
able is an
> integer?
if isinstance(var, (int, long)):
print 'var (%r) is an integer' % var
elif isinstance(var, float) and int(var) == var:
print 'var (%r) is a float that could be an integer' % var
else:
print 'var (%r) is not an i
delete all the
.py, .pyc, .pyo files you put in the zip. Compress them
using "DEFLATE", since Python's zipfile module doesn't do
BZIP2 compression (yet).
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ot;airplane", "car", "boat"]
select = None
while missing(select, vehicles):
select = raw_input("Which vehicle?")
For this particular test, there happens to be an idiom you can use:
vehicles = ["airplane", "car", "boat"]
select = None
while select not in vehicles:
select = raw_input("Which vehicle?")
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
rst use of a module, and
> perhaps aviod the surprise of an installation that continues to grow
> after a completed installation...
Another reason is to allow efficient access to python for users who
do not have permission to create files (the .pyc and .pyo files) in
Python's library dire
ll of this you will have to think a lot about
exactly what code is being executed. A help to figuring this out
is to remember that if you import a module you get a new and
different copy of the module from the main program.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
(accessible as
news:gmane.comp.python.wxpython), and if it important enough to
you, offer a bounty for help reflecting its importance to you.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
pping source code to python. Eventually there will be another form
available (the AST form), but that will show up no earlier than 2.5.
As a matter of pure practicality, it turns out you can probably use
almost the same code to look at 2.3 and 2.4 byte codes.
--Scott David Daniels
[EMAIL PROTECTE
t;MyFile.txt", "w")
> MyFile.write("This is a test.")
> MyFile.close()
I cannot help you if you don't tell me what went wrong.
Both bits of code seem to do the same thing for me.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
obj):
try:
return thevar
except NameError:
raise AttributeError
> Am I about to shoot myself in the foot?
Well, usually all this playing is good for understanding how Python
works, but makes your connections less than explicit, and we know
that explic
back to open().
I expect somewhere previously in the same frame (perhaps the
interpreter top level) you had done either "file = open(...)"
or "file = file(...)" which would prevent you from getting to the
file in __builtins__.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
if values:
total = values[0]
for element in values[1:]:
total += element
return total
else:
return 0
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
print sys.getrefcount(q),
r = None
print sys.getrefcount(q)
Note that whenever you call sys.getrefcount, the argument to the
function itself will increase the count by 1. This demonstrates that:
print sys.getrefcount(object())
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
efault DB _is_
the Jet Database engine. Easiest access for me is through the
win32 module 'odbc'.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
except KeyError:
bin[week] = [full, not full]
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
trical situations.
Although it is _way_ too late to try something like this, once upon
a time you could have done all of this using the one's complement
operator:
~0 does exist and is distinct from 0.
So you could talk about a slice:
str[4 : ~2]
and so on.
--Scott David Daniels
for fear of leaking memory, even though it will
most often turn out the objects being DECREF'ed by distinct threads are
themselves distinct.
In short, two Python threads running simultaneously cannot trust that
any basic Python data structures they access are in a consistent state
without som
, which
> is exactly the same as you would write today.
Actually, a[1 : -1] is how you get to drop the first and
last characters today. I suspect you knew this and were
just a bit in a hurry criticizing a lame-brained scheme.
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ght want to rewrite as:
def main():
choices = {1: function_a, 2:function_b}
choices[option]()
while iteration:
choices[option]()
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
In article:
http://humorix.org/articles/2005/08/notice/
... 6. The use of semantically significant whitespace in Python®
programs might be protected by intellectual property laws in
five (5) countries,
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org
sed(list(enumerate(data))):
if 'DEL' in text:
removed.append(text)
else:
del data[position]
This uses reversed so positions remain valid as the list is pruned.
--Scott David [EMAIL PROTECTED]
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Sybren Stuvel wrote:
> ... Computers aren't happy. They couldn't care less about the
> programming language.
This reminds me of a quote I love (and wish I could cite the
originator):
Don't anthropomorphize computers, they don't like that.
--Scott David Daniels
# doc string, author, copyright, and license info
# and a line like: __version__ = "0.2"
product.py
setup.py
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
LIB_VERSION
There were some fixes you can see described at 'http://www.zlib.net/'
that are going into python 2.5. If you can figure it out yourself,
you could build an alternative zlib module to either sit beside
/DLLs/zlib.pyd or replace it.
--Scott David Daniels
[EMAIL PROTECTED]
--
ht
bj = SomeDemo()
obj.foo = 123
obj.foo += 1
del obj.foo
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
rk on py2exe over the years, which has benefited the Windows
> Python community immeasurably.
I second this.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
s = []
else:
self.folders = folders
...
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
(x1, y1), (x2, y2) = p1, p2
return math.sqrt((x2 - x1)**2 + (y2 - y1)**2)
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
if necessary,
and are built by people with the right to redistribute it. So, at the
cost of a two-step install, you can legally build and distribute Python
2.4 apps.
In case you don't know: I am not a lawyer; don't regard my guesses about
the legal status of things as definitive; don
Fredrik Lundh wrote:
> Scott David Daniels wrote:
>
>>MS is fairly determined to get you develop money; you may not
>>redistribute the C runtime with your app from the "free" stuff.
>
> that's a myth, based on a flawed reading of the MS license. to
o work, and _then_ if you have
problems ask "smart questions" here about specific issues you have
with getting your code to work.
See:
http://www.catb.org/~esr/faqs/smart-questions.html
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ons to get the canonical value,
and the guarantee simplifies the user's code.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Jive Dadson wrote:
I've forgotten what we are arguing about, but I'm sure I'm right.
^^^ QOTW
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
forts to measure
ease of use and reliability. They did not simply start with a good
(or great) guess and charge forward. They produced the mouse, and the
earliest "linked" documents that I know of.
http://sloan.stanford.edu/MouseSite/1968Demo.html
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
David Isaac wrote:
"Scott David Daniels" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]:
Numarray is the future, Numeric is the "past",
This statement is not obviously true. See the recent discussion on the
developer lists. (Search for Numeric3.)
Alan Isaac
if magnitude >= 1.0:
break
if magnitude < .001:
return 'zero %s' % units
else:
prefix = ''
if value < 0:
return '-%.3f %s%s' % (magnitude, prefix, units)
Neil Benn wrote:
Scott David Daniels wrote:
Kind of fun exercise (no good for British English).
what's American about it? If anything, it's more French than American ;-)
Well, actually this started with scaling integers, and I was worried
about a billion / billionth (and up / down). I
lso be a task from a tutorial page. I'd just make sure
to hand out clues rather than answers, and wait for evidence of work
between clues.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e:
print 'and', blunge
Because of how iterables work, you know you can do this locally
without looking all around to see what "whatever" is.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
NameError:
def enumerate(iterable):
...
try:
test = sorted
except NameError:
def sorted(iterable, cmp=None, key=None, reverse=False):
...
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
or syntax that works without showing syntax that doesn't
work, along with the _complete_ error messages that you get when you try
your syntax. You seem to be asking for help without assisting your
rescuers. You should be trying to make it easy for them.
Google for "smart questions".
--S
s, but they don't _guarantee_ it.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
ike:
if __debug__ and test:
raise AssertionError, text
As far as raise goes, where you have been writing:
raise "some complaint"
you could simply use:
raise ValueError, "some complaint"
or:
raise ValueError("some complaint")
--Scott David Daniels
thon/Recipe/52549
not show you what args it accepts, but decorators, a Python 2.4
invention, will typically obscure the interface of the decorated
function. Since they wrap _any_ function call, they typically
take the most general arguments possible in order to accommodate
the widest range of fu
hould be a more cannonical way.
You could start with this code and add '\0' as a line terminator:
http://members.dsl-only.net/~daniels/ilines.html
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
e code this way allows you to say, watcher-by-watcher,
where to get the parent for the message box. You would then use
it as follows:
@exceptionwatcher(someholder, 'frame')
def something(somearg)
if somearg is not None:
raise ValueE
y sysadmin
(and many other users) would want to do on practically a daily basis.
The general model is that you produce a module, and if it gains a
audience to a stable interface, inclusion might be considered. I'd
suggest you put up a recipe at ActiveState.
--Scott David Daniels
[EMAIL PRO
t variables the exec can write:
exec 'k = 3 * k' in globals(), locals()
This is why locals() does not do write-back.
The rule below (which was high on the list when searching for exec),
tells the exact rules, the above stuff is just why.
http://www.python.org/doc/2.4/ref/dyna
Attila Szabo wrote:
2005, Feb 25 -> Scott David Daniels wrote :
Attila Szabo wrote:
>>...lambda x: 'ABC%s' % str(x) ...
OK, to no real effect, in main you define an unnamed function that
you can never reference. Pretty silly, but I'll bite.
This code was simplified,
splay an image in Python? - I've run over Tkinter, but obviously
in all the wrong places.
You probably want Fredrik Lundh's PIL (Python Imaging Library) package
to read and manipulate the images, and then use TKinter to display the
images.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.
me = 'libinfo.' + modulename
module = __import__(fullname)
sys.modules[fullname] = module
module.libinfo()
CFLAGS += module.CFLAGS
Remember, this is computer science, not mathematics. We are allowed to
use more than a single (possibly strangely draw
Tony Meyer wrote:
How can I select a random entry from a dictionary, regardless of its
key-values?
a = random.choice(d.keys())
a, d[a]
Or even:
key, value = random.choice(d.items())
or:
value = random.choice(d.values())
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org
re
out how to accomplish your real goal in the normal flow of the language.
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
can define sorted in 2.3 as:
def sorted(iterable):
result = list(iterable)
result.sort()
return result
The full sorted functionality can be (and has been) defined in 2.3,
but just using 2.4 would be a better bet.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.o
do_a_bunch(self)
def some_other_method(self):
...
do_a_bunch(self)
def mangle(self):
...
do_other_stuff(self)
I'm newbie, sure.
That is why I was trying to figure out your original requirement,
not how to accomplish your original plan. I was trying to see
e:
ordered_keys = sorted(v, key=lambda name: v[name][9]['date'])
In 2.3, or earlier, use "decorate-sort-undecorate":
decorated = [(value[9]['date'], key)
for key, value in v.iteritems()]
decorated.sort()
result = [key for key, date in deco
y
string?
If you want the other effect, you can always do:
"%s" % (x or '')
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
entries into a list
of strings?
First break into strings, then space-split the non-strings.
def splitup(somestring):
gen = iter(somestring.split('"'))
for unquoted in gen:
for part in unquoted.split():
yield part
yield gen.next().join('""')
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
r root, dirs, files in os.walk(base):
if root != base:
dirs[:] = []
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
html
For some versions of "buffers", this might work.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Stewart Midwinter wrote:
I'd like to do something like the following:
a = 1; b = 2; c = None
mylist = [a, b, c]
for my in mylist:
if my is None:
print 'you have a problem with %s' % my #this line is problematic
You have a problem with None
What I want to see in the output is:
How do
frobotz = os.environ['NotThere']
jangle = int(os.environ['WEIGHT'])
...
except KeyError, e:
print 'Mising env var %r. Fix it and try again' % e.args
raise SystemExit
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
st likely to find them distinct in three
comparisons. Using hashes, three file reads and three comparisons
of hash values. Without hashes, six file reads; you must read both
files to do a file comparison, so three comparisons is six files.
Naturally, as it grows beyond three, the deference grows
ry definition in the first place;
I couldn't convince myself there was a good, obvious, resolution.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
irs where position is an
offset within the "current" block.
'''
You might consider taking a look at providing that form.
-Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Look into Ruth Chabay's physics books for a possibly appropriate
choice and surpisingly on-topic choice. That is, unless you are
talking computational physics at the level of "ab initio
chemistry" and friends.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/m
m__(self, *args, **kwargs):
print '%s._gi_(*%r, **%r):' % (self.name, args, kwargs),
return input()
>>> c = CheckOut('a')
>>> b = c[1, ...]
c.gi(*(1, Ellipsis), **{}): self.name * 7
>>> b
'aaa'
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
:
class Hash(object):
def __init__(self, **kwargs):
for key,value in kwargs.items():
setattr(self, key, value)
__getitem__ = getattr
__setitem__ = setattr
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Steven Bethard wrote:
Thanks for the pointers. What's the "doco gadget" you're talking about?
I conclude from this question that you are not using a Windows python.
I suspect, therefore, the answer is Gilda Ratner's " Never mind."
--Scott Davi
...: often, however, such
names are necessary when discussing abstract code properties.
-Scott
--
http://mail.python.org/mailman/listinfo/python-list
if char in multis:
break
else:
yield string
raise StopIteration
parts = multis[char]
prelude, string = string[:pos], string[pos+1:]
for expansion in expanded(string, multis):
for middle in parts:
yield prelude + middle + expansion
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Nick Craig-Wood wrote:
Scott David Daniels <[EMAIL PROTECTED]> wrote:
You can simplify this:
class Hash(object):
def __init__(self, **kwargs):
for key,value in kwargs.items():
setattr(self, key, value)
__getitem__ = getattr
__setitem__ = setattr
That d
quot;
For earlier pythons, use:
python -c "import sys; nms = sys.modules.keys(); nms.sort(); print nms"
or:
python -c "import sys; print sys.modules.keys()"
if you don't care about order.
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
?
>
> Thanks!
How about sys.byteorder?
At least if you are using array.array, note the "byteswap" method:
>>> import array
>>> v = array.array('h',range(8))
>>> v
array('h', [0, 1, 2, 3, 4, 5, 6, 7])
>>> v.byt
_111 == 7..77377
1..10010010101
9..9329765872
7..767
Takes a bit to associate 9 with base ten, but lexing the number is
duck soup. Note I am not advocating this syntax any more than Josiah
is advocating his. I just find alternate representations interesting.
--Scott David Daniels
[EMAIL
biner wrote:
> I am using a program that has to read binary data from files coming
> from different machines. The file are always written with big endian.
Diez B. Roggisch wrote:
[Scott David Daniels wrote]
How about sys.byteorder?
This doesn't help, as he wants to read files f
ept KeyError:
raise NoRuleError, (self.current, newstate)
# or pass to ignore missing transitions.
else:
action(self)
This method belongs in BaseFrame and assumes a class like:
class NoRuleError(ValueError):
def __str__(self):
return 'No transition defined for %r -> %r' % self.args
--Scott David Daniels
[EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list
Zak Arntson wrote:
On Fri, 03 Dec 2004 14:48:30 -0800, Scott David Daniels
<> wrote:
question: A dictionary of dictionaries is slower than a
dictionary of tuples, right? Because when Python accesses a
dictionary, it produces a hash from the key and finds that in its hash
table. Produ
701 - 800 of 2115 matches
Mail list logo