[issue16856] Segfault from calling repr() on a dict with a key whose repr raise an exception

2013-01-03 Thread David M. Cooke
New submission from David M. Cooke: The following segfaults: class A(int): def __repr__(self): raise Exception() a = A() d = {a : 1} repr(d) This is with Python 3.3.0, running on Mac OS 10.7.5, from MacPorts: Python 3.3.0 (default, Sep 29 2012, 08:16:08) [GCC 4.2.1 Compatible

Re: Code that ought to run fast, but can't due to Python limitations.

2009-07-06 Thread David M . Cooke
html5lib has several implementations for several languages, it may actually be worth it to generate lexers for each language from one specification file. Take care, David M. Cooke david.m.co...@gmail.com -- http://mail.python.org/mailman/listinfo/python-list

Re: setting a breakpoint in the module

2006-08-23 Thread David M. Cooke
failing condition, for instance. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-18 Thread David M. Cooke
) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Coding style

2006-07-18 Thread David M. Cooke
[EMAIL PROTECTED] (David M. Cooke) writes: Bruno's already mentioned that iterators and generators aren't sequences. Numpy arrays act like the other sequence types: a = numpy.array([]) a array([], dtype=int64) len(a) 0 bool(a) False (0-dimensional numpy arrays are pathological anyways

Re: ANN: NumPy 0.9.8 released

2006-05-17 Thread David M. Cooke
the latest setuptools (0.6b1). The hacks I added to get easy_install and numpy.distutils to get along are hard enough without trying to be backward compatible :-( -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster

Re: pow (power) function

2006-03-17 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Python advocacy in scientific computation

2006-03-06 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Scientific Computing with NumPy

2006-02-10 Thread David M. Cooke
setup.py build python setup.py install. Do you need Tiger (10.4) or Panther (10.3) compatibility? -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: good library for pdf

2006-01-26 Thread David M. Cooke
/pyPdf/. I haven't tried it, but it looks interesting. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: idea of building python module using pyrex

2005-12-09 Thread David M. Cooke
C code, but it does the job well. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Underscores in Python numbers

2005-11-19 Thread David M. Cooke
*(a8 + x2*a10 (or least that's what I like to write). Now, if I were going to higher precision, I'd have more digits of course. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http

Re: authentication for xmlrpc via cgi

2005-09-22 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a way to determine -- when parsing -- if a word contains a builtin name or other imported system module name?

2005-08-04 Thread David M. Cooke
there :) For modules, sys.modules is a dictionary of the modules that have been imported. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: without shell

2005-06-10 Thread David M. Cooke
to it). -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Annoying behaviour of the != operator

2005-06-10 Thread David M. Cooke
Robert Kern [EMAIL PROTECTED] writes: greg wrote: David M. Cooke wrote: To solve that, I would suggest a fourth category of arbitrary ordering, but that's probably Py3k material. We've got that: use hash(). [1+2j, 3+4j].sort(key=hash) What about objects that are not hashable? The purpose

Re: Annoying behaviour of the != operator

2005-06-09 Thread David M. Cooke
, the order will stay the same. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: computer algebra packages

2005-06-08 Thread David M. Cooke
be possible. I haven't had the time to actually do anything, though :-) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: editor for shelve files

2005-05-01 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a package with convolution and related methods?

2005-04-21 Thread David M. Cooke
). -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Threads and variable assignment

2005-04-12 Thread David M. Cooke
where timestamps w/ state changes are pushed on in thread 1, and popped off and analysed before logging in thread 2. (Or something; this just popped in my head.) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster

Re: python/svn issues....

2005-04-12 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke http://arbutus.physics.mcmaster.ca/dmc/ |[EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list

Re: richcmpfunc semantics

2005-04-07 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: curious problem with large numbers

2005-04-07 Thread David M. Cooke
) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Gnuplot.py and, _by far_, the weirdest thing I've ever seen on my computer

2005-04-04 Thread David M. Cooke
at it] -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: numeric module

2005-04-01 Thread David M. Cooke
] and that'll work. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: numeric module

2005-04-01 Thread David M. Cooke
:-) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: itertools to iter transition

2005-03-30 Thread David M. Cooke
classmethod, and the datetime extension module use the C version (the METH_CLASS flag). And staticmethod (and METH_STATIC) aren't used at all in 2.3 or 2.4 :-) [if you ignore __new__] -- ||\/| /--\ |David M. Cooke |cookedm(at)physics

Re: breaking up is hard to do

2005-03-25 Thread David M. Cooke
:-) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Using python to extend a python app

2005-03-24 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Passing arguments to python from URL

2005-03-22 Thread David M. Cooke
this: import cgi form = cgi.FieldStorage() if form.getvalue('sort') == 'ascending': ... sort in ascending order ... etc. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org

Re: how to handle repetitive regexp match checks

2005-03-17 Thread David M. Cooke
def __getitem__(self, name): return self.m.group(name) Then, use it like for line in fo: m = Matcher(line) if m.match(rx1): do something elif m.match(rx2): do something else: error -- ||\/| David M. Cooke cookedm(at)physics(dot)mcmaster(dot)ca

Re: SAX parsing problem

2005-03-15 Thread David M. Cooke
!) is not guaranteed to get all contiguous character data in one call. Also check if .skippedEntity() methods are firing. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman

Re: How to write python plug-ins for your own python program?

2005-03-03 Thread David M. Cooke
doesn't name their plugin 'os; os.system(rm -rf /); import sys' Use __import__ instead. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: binutils strings like functionality?

2005-03-03 Thread David M. Cooke
missing tabs (\t). The GNU binutils string utility looks for \t or [\x20-\x7e]. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: [ANN] Python 2.4 Quick Reference available

2005-02-19 Thread David M. Cooke
what I believe the consensus is about the usage of open vs. file. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: LinearAlgebra incredibly slow for eigenvalue problems

2005-01-28 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: LinearAlgebra incredibly slow for eigenvalue problems

2005-01-28 Thread David M. Cooke
, check that import Numeric Numeric.__file__ gives you something you're expecting, and not something else. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python

Re: pickling extension class

2005-01-18 Thread David M. Cooke
. The tp_name slot of your extension type should be model.hyper.PeriodicGrid. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: readline, rlcompleter

2005-01-11 Thread David M. Cooke
). Have a look at the readline info page, or the man page. The syntax of readline.parse_and_bind is the same as that of an inputrc file. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http

Re: OT: MoinMoin and Mediawiki?

2005-01-11 Thread David M. Cooke
:-) -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: why not datetime.strptime() ?

2005-01-10 Thread David M. Cooke
with same date and time fields)}, It probably would help to add some documentation to add to the datetime module documentation. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org

Re: Python3: on removing map, reduce, filter

2005-01-10 Thread David M. Cooke
, best of 3: 216 usec per loop So factor of 2, instead of 13700 ... -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: getattr() woes

2004-12-28 Thread David M. Cooke
is if getattr, when raising AttributeError, somehow reused the old traceback (which would point out the original problem). I don't know how to do that, though. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot

Re: Namespaces and the timeit module

2004-12-14 Thread David M. Cooke
in a module. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list

Re: Distutils vs. Extension header files

2004-12-10 Thread David M. Cooke
. -- ||\/| /--\ |David M. Cooke |cookedm(at)physics(dot)mcmaster(dot)ca -- http://mail.python.org/mailman/listinfo/python-list