Peter Otten schrieb:
> Peter Otten wrote:
>
> If you create indices for floors (and rooms)
>
> cur.execute("""create unique index room_index on rooms (fid, number);""")
> cur.execute("""create unique index floor_index on floors (floor);""")
>
> the addition of missing rows can be simplified to
>
On Sun, May 2, 2010 at 11:24 PM, pp wrote:
> Hello all,
>
> I have this equation to solve where variable
> LHS is a sparse matrix and RHS is an array .
> c = linsolve.spsolve(LHS, RHS)
>
>
> i get this error
> warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,'\
> ' instal
Hello all,
I have this equation to solve where variable
LHS is a sparse matrix and RHS is an array .
c = linsolve.spsolve(LHS, RHS)
i get this error
warn( 'scipy.sparse.linalg.dsolve.umfpack will be removed,'\
' install scikits.umfpack instead'
what is the reason for this and d
dmtr, 03.05.2010 07:39:
ANTLR
I don't know if it's that easy to get started with though. The
companion for-pay book is *most excellent*, but it seems to have been
written to the detriment of the normal online docs.
IMO ANTLR is much easier to use compared to any other tool simply
because it h
>
> > ANTLR
>
> I don't know if it's that easy to get started with though. The
> companion for-pay book is *most excellent*, but it seems to have been
> written to the detriment of the normal online docs.
>
> Cheers,
> Chris
> --http://blog.rebertia.com
IMO ANTLR is much easier to use compared to
On Sun, May 2, 2010 at 10:10 PM, dmtr wrote:
> On May 2, 12:54 pm, Andreas Löscher chemnitz.de> wrote:
>> Hi,
>> I am looking for an easy to use parser. I am want to get an overview
>> over parsing and want to try to get some information out of a C-Header
>> file. Which parser would you recommend
On May 2, 12:54 pm, Andreas Löscher wrote:
> Hi,
> I am looking for an easy to use parser. I am want to get an overview
> over parsing and want to try to get some information out of a C-Header
> file. Which parser would you recommend?
ANTLR
--
http://mail.python.org/mailman/listinfo/python-list
* Terry Reedy:
* Alf P. Steinbach:
* Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs.
Testing:
>>> t = ([], [], [])
>>>
Steven D'Aprano wrote:
> The simplest way to speed the above code up is not to start from the
> beginning each time. That requires two very small changes. And since
> deletions from the front of the list are slow, MRAB's suggestion is also
> a good idea.
Those two speed-ups provide worst-case line
> Subject: ANN: expy 0.6.6 released!
> To: "python list"
> Cc: "CAPI Python"
> Date: Monday, May 3, 2010, 3:24 AM
> EXPY is an express way to extend Python!
>
> EXPY provides a way to extend python in an elegant way. For
> more information and a tutorial, see: http://expy.sourceforge.net/
>
I'
On May 3, 9:14 am, Steven D'Aprano wrote:
> If it is any arbitrary object, then "x and True or False" is just an
> obfuscated way of writing "bool(x)". Perhaps their code predates the
> introduction of bools, and they have defined global constants True and
> False but not bool. Then they removed
James Porter wrote:
Functions like numpy.zeros_like use ndarray.__new__(subtype,
...) to create new arrays based on the shape of other arrays.
Maybe the real answer to this question is "NumPy is doing it wrong"
Yes, I think NumPy is doing it wrong, even for subclasses
written in Python. If th
On May 2, 12:14 pm, Paul McGuire wrote:
> While sifting through some code looking for old "x and y or z" code
> that might better be coded using "y if x else z", I came across this
> puzzler:
>
> x = and True or False
>
> What is "and True or False" adding to this picture? The boolean
> expr
On Sun, 02 May 2010 18:07:31 +0200, Christian Heimes wrote:
>> I'm interested in gathering some statistics on this, and to do so I
>> need a way of measuring the list's logical size versus its actual size.
>> The first is easy: it's just len(list). Is there some way of getting
>> the allocated siz
EXPY is an express way to extend Python!
EXPY provides a way to extend python in an elegant way. For more information
and a tutorial, see: http://expy.sourceforge.net/
What's new:
1. Special methods can now take @throws decorators.
2. Added convenience macros _NEW and _CheckExact for extension
On Sun, 02 May 2010 10:14:44 -0700, Paul McGuire wrote:
> While sifting through some code looking for old "x and y or z" code that
> might better be coded using "y if x else z", I came across this puzzler:
>
> x = and True or False
>
> What is "and True or False" adding to this picture? Th
On 5/2/2010 3:58 PM, Robert Kern wrote:
Well, I think we can change zeros_like() and the rest to work around
this issue. Can you bring it up on the numpy mailing list?
def zeros_like(a):
if isinstance(a, ndarray):
res = numpy.empty(a.shape, a.dtype, order=a.flags.fnc)
res.fill(0)
res = res.view(
Andreas Löscher wrote:
> Hi,
> I am looking for an easy to use parser. I am want to get an overview
> over parsing and want to try to get some information out of a C-Header
> file.
To get information from a header file, try Tools/scripts/h2py.py
Regards,
Martin
--
http://mail.python.org/mailman/
On May 2, 10:14 am, Paul McGuire wrote:
> While sifting through some code looking for old "x and y or z" code
> that might better be coded using "y if x else z", I came across this
> puzzler:
>
> x = and True or False
>
> What is "and True or False" adding to this picture? The boolean
> expr
On May 2, 1:51 pm, Robert Kern wrote:
> On 2010-05-02 15:28 , Carl Banks wrote:
>
>
>
> > On May 2, 10:48 am, James Porter wrote:
> >> On 5/2/2010 4:34 AM, Carl Banks wrote:
>
> >>> Why don't you use mysubtype.__new__(mysubtype,...)?
>
> >>> If you wrote mysubtype in C, and defined a different tp
On May 2, 3:26 am, Jason wrote:
> On May 2, 5:52 pm, Carl Banks wrote:
>
> > Not sure what you're doing here. It looks like you are being passed
> > an object of a given type, then you get the type object, call it to
> > create another object of that type, and assign it to object->instance.
>
>
On 2010-05-02 15:03 , James Porter wrote:
And then in Python:
A = iMesh.Array(numpy.array([1,2,3,4,5]), instance=mesh)
numpy.zeros_like(A) # fails here
Inside NumPy, zeros_like looks like this (there's a bit more than this,
but it's irrelevant to this problem):
def zeros_like(a):
if isinstanc
On 2010-05-02 15:28 , Carl Banks wrote:
On May 2, 10:48 am, James Porter wrote:
On 5/2/2010 4:34 AM, Carl Banks wrote:
Why don't you use mysubtype.__new__(mysubtype,...)?
If you wrote mysubtype in C, and defined a different tp_new than
ndarray, then this exception will trigger. And it oug
On May 2, 10:48 am, James Porter wrote:
> On 5/2/2010 4:34 AM, Carl Banks wrote:
>
> > Why don't you use mysubtype.__new__(mysubtype,...)?
>
> > If you wrote mysubtype in C, and defined a different tp_new than
> > ndarray, then this exception will trigger. And it ought to; you don't
> > want to u
On May 2, 12:54 pm, Andreas Löscher wrote:
> Hi,
> I am looking for an easy to use parser. I am want to get an overview
> over parsing and want to try to get some information out of a C-Header
> file. Which parser would you recommend?
>
> Best,
> Andreas
Pyparsing: http://pyparsing.wikispaces.com
On Sun, May 2, 2010 at 1:14 PM, Paul McGuire wrote:
> While sifting through some code looking for old "x and y or z" code
> that might better be coded using "y if x else z", I came across this
> puzzler:
>
> x = and True or False
>
> What is "and True or False" adding to this picture? The boo
On 5/2/2010 1:43 PM, Robert Kern wrote:
Perhaps things would be clearer if you could post the C code that you've
written that fails. So far, you've only alluded at what you are doing
using Python-syntax examples.
I'm not sure how much this will help, but here you go. The actual C code
probably
Hi,
I am looking for an easy to use parser. I am want to get an overview
over parsing and want to try to get some information out of a C-Header
file. Which parser would you recommend?
Best,
Andreas
--
http://mail.python.org/mailman/listinfo/python-list
On 5/2/2010 8:11 AM, dmitrey wrote:
Python 2.6.5 r265:79063
set().update(set()) is None
True
while I expect result of update to be set.
Also, result of
set().add(None)
is None while I expect it to be set with element None (or, maybe, it
should be empty set?)
'Expect' has two different meaning
Wolfgang Meiners wrote:
> one to many relationships are fairly common, i think. So there should be
> a recommended way to insert data into such a relation using python.
>
> Given the following programm, what is the recommended way to insert the
> list of NewEmployees to the database?
>
> ==
On 2010-05-02 12:48 , James Porter wrote:
On 5/2/2010 4:34 AM, Carl Banks wrote:
Why don't you use mysubtype.__new__(mysubtype,...)?
If you wrote mysubtype in C, and defined a different tp_new than
ndarray, then this exception will trigger. And it ought to; you don't
want to use ndarray's tp_ne
Peter Otten wrote:
> def f():
> big_beast = list(range(10**100))
> return big_beast and True or False
> x = f()
>
> it would prevent that a big_beast reference becomes visible outside the
> function and allow for immediate release of its memory.
what's wrong in bool(big_beast)?
--
By Z
goldtech schrieb:
Thank you to posters for help to my question. Seems I had trouble with
triple quotes strings in the PythonWin shell. But using the Idle shell
things work as expected. But this is probably another issue...any way,
w/Idle's shell I got the "action" regarding multiline strings I
ex
Paul McGuire wrote:
> While sifting through some code looking for old "x and y or z" code
> that might better be coded using "y if x else z", I came across this
> puzzler:
>
> x = and True or False
>
> What is "and True or False" adding to this picture? The boolean
> expression part is alr
This is a bit of an odd question, but is there any way for a Python
debugger to suppress I/O generated by the program which is being
debugged? I guess an "obvious" thing to do would be to replace core
parts of the standard library and change any relevant imports in the
locals and globals dicts to f
On 5/2/2010 4:34 AM, Carl Banks wrote:
Why don't you use mysubtype.__new__(mysubtype,...)?
If you wrote mysubtype in C, and defined a different tp_new than
ndarray, then this exception will trigger. And it ought to; you don't
want to use ndarray's tp_new to create an object of your subclass, if
While sifting through some code looking for old "x and y or z" code
that might better be coded using "y if x else z", I came across this
puzzler:
x = and True or False
What is "and True or False" adding to this picture? The boolean
expression part is already evaluating to a boolean, so I do
Christian Heimes wrote:
def slots(lst):
> ... return (sys.getsizeof(lst) - sys.getsizeof([])) /
D'oh!
Peter
--
http://mail.python.org/mailman/listinfo/python-list
I'm interested in gathering some statistics on this, and to do so I need
a way of measuring the list's logical size versus its actual size. The
first is easy: it's just len(list). Is there some way of getting the
allocated size of the list?
With Python 2.6 and newer you can use sys.getsizeof() t
Steven D'Aprano wrote:
> Python lists are over-allocated: whenever they need to be resized, they
> are made a little bit larger than necessary so that appends will be fast.
>
> See:
>
> http://code.python.org/hg/trunk/file/e9d930f8b8ff/Objects/listobject.c
>
> I'm interested in gathering some s
On Sun, 2 May 2010 12:59:35 +0100
michel parker wrote:
>
> hi,
> i have just installed python3.1 with opt=g option.
> but when i set python executable in wingide to usr/local/bin/python3.1 it
> says :
I don't know anything about wingide but I think your problem is simply
a missing slash.
/usr/
Francesco Bochicchio wrote:
Anyway i think that list.extract( old_list, predicate ) -> new_list
would be a nice addition to the standard library
You could use filter( predicate, old_list ) -> new_list
-- HansM
--
http://mail.python.org/mailman/listinfo/python-list
Python lists are over-allocated: whenever they need to be resized, they
are made a little bit larger than necessary so that appends will be fast.
See:
http://code.python.org/hg/trunk/file/e9d930f8b8ff/Objects/listobject.c
I'm interested in gathering some statistics on this, and to do so I need
On Sun, 02 May 2010 05:11:40 -0700, dmitrey wrote:
> Python 2.6.5 r265:79063
set().update(set()) is None
> True
> while I expect result of update to be set.
Change your expectations. Generally, methods which modify the object
rather than creating a new one return None.
>>> s = set([1,2,3])
In article <0bd314a8-db65-43f1-a999-521e2ed71...@n15g2000yqf.googlegroups.com>,
dmitrey wrote:
>
>Python 2.6.5 r265:79063
set().update(set()) is None
>True
>while I expect result of update to be set.
>Also, result of
>set().add(None)
>is None while I expect it to be set with element None (or,
Peter Otten wrote:
If you create indices for floors (and rooms)
cur.execute("""create unique index room_index on rooms (fid, number);""")
cur.execute("""create unique index floor_index on floors (floor);""")
the addition of missing rows can be simplified to
missing = c2.execute("""select distin
Python 2.6.5 r265:79063
>>>set().update(set()) is None
True
while I expect result of update to be set.
Also, result of
set().add(None)
is None while I expect it to be set with element None (or, maybe, it
should be empty set?)
Regards, D.
--
http://mail.python.org/mailman/listinfo/python-list
hi,
i have just installed python3.1 with opt=g option.
but when i set python executable in wingide to usr/local/bin/python3.1 it says :
Some values are invalid:
- Python executable 'usr/local/bin/python3.1' is not in path
Please correct the values and try again.
Please help. What is going to be
hi,
yup problem solved module was missing libgdbm-dev
> From: kushal.kumaran+pyt...@gmail.com
> Date: Sun, 2 May 2010 16:38:28 +0530
> Subject: Re: help error : Failed to build these modules: _dbm
> To: michelpar...@live.com
> CC: python-list@python.org
>
> On Sun, May 2, 2010 at 3:30 PM, miche
In article <877hnpjtdw@rudin.co.uk>,
Paul Rudin wrote:
>"Karin Lagesen" writes:
>
>> Hello.
>>
>> I have approx 83 million strings, all 14 characters long. I need to be
>> able to take another string and find out whether this one is present
>> within the 83 million strings.
>>
>> Now, I have
In article ,
Jean-Michel Pichavant wrote:
>Jabapyth wrote:
>> At least a few times a day I wish python had the following shortcut
>> syntax:
>>
>> vbl.=func(args)
>>
>> this would be equivalent to
>>
>> vbl = vbl.func(args)
>>
>> example:
>>
>> foo = "Hello world"
>> foo.=split(" ")
>> print foo
On Sun, May 2, 2010 at 3:30 PM, michel parker wrote:
> Hi,
> When i make python 3.1 on my ubuntu 9.10 i get following error :
>
> Failed to build these modules:
> _dbm
> Please help me.
> I have done :
>
> apt-get build-dep python2.5
>
> but to no avail.
> Cheers
>
>
Probably the packages libdb4.
On May 2, 5:52 pm, Carl Banks wrote:
> Not sure what you're doing here. It looks like you are being passed
> an object of a given type, then you get the type object, call it to
> create another object of that type, and assign it to object->instance.
Sorry, I should have noted that the "NautilusP
On Sun, 02 May 2010 04:04:11 -0400, Terry Reedy wrote:
> On 5/2/2010 1:05 AM, Alf P. Steinbach wrote:
>> On 02.05.2010 06:06, * Aahz:
>
>>> and sometimes
>>> they rebind the original target to the same object.
>>
>> At the Python level that seems to be an undetectable null-operation.
>
> If you
Hi,
When i make python 3.1 on my ubuntu 9.10 i get following error :
Failed to build these modules:
_dbm
Please help me.
I have done :
apt-get build-dep python2.5
but to no avail.
Cheers
On May 1, 4:04 am, Jason wrote:
> I'm having a bit of trouble with C/Python bindings. Particularly,
> trying to set an instance variable from C when the object is
> initialised using PyObject_SetAttrString, but nothing seems to happen.
> The C initialisation code is:
>
> static void
> nautilus_pyt
On May 1, 11:03 pm, James Porter wrote:
> I've been trying to write a Python C extension module that uses NumPy
> and has a subtype of numpy.ndarray written in C. However, I've run into
> a snag: calling numpy.ndarray.__new__(mysubtype, ...) triggers an
> exception in the bowels of Python (this is
On Sun, 02 May 2010 17:09:36 +1000, Lie Ryan wrote:
> On 05/02/10 10:58, Steven D'Aprano wrote:
>> On Sun, 02 May 2010 05:08:53 +1000, Lie Ryan wrote:
>>
>>> > On 05/01/10 11:16, Steven D'Aprano wrote:
>> On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
>>
>> In practic
On Sun, 02 May 2010 16:28:28 +1000, Lie Ryan wrote:
> On 05/02/10 10:58, Steven D'Aprano wrote:
>>> > And Python's object system
>>> > makes it that the argument to __getattr__ is always a string even
>>> > though there might be a valid variable that corresponds to it:
>> That is nothing to do wit
On 5/2/2010 1:05 AM, Alf P. Steinbach wrote:
On 02.05.2010 06:06, * Aahz:
and sometimes
they rebind the original target to the same object.
At the Python level that seems to be an undetectable null-operation.
If you try t=(1,2,3); t[1]+=3, if very much matters that a rebind occurs.
Grant
lkcl :
> at least _some_ input would be good! the knowledge doesn't have to
>be there: just the bugreports saying "there's a problem and here's
>exactly how you reproduce it" would be a start!
>> So please make it simpler for more people to help.
> ... how?? there's a bugtracker, wiki, svn repo
On 05/02/10 10:58, Steven D'Aprano wrote:
> On Sun, 02 May 2010 05:08:53 +1000, Lie Ryan wrote:
>
>> > On 05/01/10 11:16, Steven D'Aprano wrote:
>>> >> On Fri, 30 Apr 2010 12:34:34 -0400, D'Arcy J.M. Cain wrote:
>>> >>
>>> >> In practice though, I think that's a difference that makes no
>>> >> di
62 matches
Mail list logo