New submission from Ole Streicher:
On Debian Hurd, there is no sem_open implementation. When I try there to create
a Queue, I get different errors, depending on the Python version:
import multiprocessing
q = multiprocessing.Queue()
gives on Python 2.7.9:
maxsize = 0
def Queue(maxsize=0
Hi,
I am curious when one should implement a __call__() and when a
__getitem__() method.
For example, I want to display functions and data in the same plot. For
a function, the natural interface would to be called as f(x), while
the natural interface for data would be f[x]. On the other hand,
Hi group,
I am trying to use a weak reference to a bound method:
class MyClass(object):
def myfunc(self):
pass
o = MyClass()
print o.myfunc
bound method MyClass.myfunc of __main__.MyClass object at 0xc675d0
import weakref
r = weakref.ref(o.myfunc)
print r()
None
This is what
Hi Thomas,
Thomas Lehmann t.lehm...@rtsgroup.net writes:
r = weakref.ref(o.myfunc)
print r()
None
k = o.myfunc
r = weakref.ref(k)
print r()
weakref at 00B80750; to 'method' at 00B59918 (myfunc)
Don't ask me why! I have just been interested for what you are trying...
This is clear:
Hello Peter,
Peter Otten __pete...@web.de writes:
Is there an actual use case?
I discussed this in the german newsgroup. Here is the use in my class:
-8---
import threading
import weakref
class DoAsync(threading.Thread):
def __init__(self,
Hi Miles,
Miles Kaufmann mile...@umich.edu writes:
You could also create a wrapper object that holds a weak reference to the
instance and creates a bound method on demand:
class WeakMethod(object):
def __init__(self, bound_method):
self.im_func = bound_method.im_func
Hello Peter,
Peter Otten __pete...@web.de writes:
What I want is to have a universal class that always works: with
unbound functions, with bound function, with lambda expressions, with
locally defined functions,
That's left as an exercise to the reader ;)
Do you have the feeling that there
Hi Peter,
Peter Otten __pete...@web.de writes:
Ole Streicher wrote:
Peter Otten __pete...@web.de writes:
What I want is to have a universal class that always works: with
unbound functions, with bound function, with lambda expressions, with
locally defined functions,
That's left
Hi Peter,
Peter Otten __pete...@web.de writes:
class Method(object):
def __init__(self, obj, func=None):
if func is None:
func = obj.im_func
obj = obj.im_self
This requires that func is a bound method. What I want is to have a
universal class that always
Hi Peter,
Peter Otten __pete...@web.de writes:
I am a bit surprised that already such a simple problem is virtually
unsolvable in python.
Btw, have you implemented such a design in another language?
No.
I think I'd go for a simpler approach, manage the lifetime of MyClass
instances
sturlamolden sturlamol...@yahoo.no writes:
On 2 Okt, 13:29, Dave Angel da...@ieee.org wrote:
If you are worried about speed, chances are you are not using Python
anyway.
I *do* worry about speed. And I use Python. Why not? There are powerful
libraries available.
If you still have need for
Hi,
I am using epydoc for my code documentation and I am curious whether
there exist a possibility to produce the output in xml format.
Reason for that is that I want to convert it to WordML and get it into
our private documentation system.
Unfortunately, the documentation does not mention xml,
Hi John,
John Machin sjmac...@lexicon.net writes:
The Morton layout wastes space if the matrix is not square. Your 100K
x 4K is very non-square. Looks like you might want to use e.g. 25
Morton arrays, each 4K x 4K.
What I found was that Morton layout shall be usable, if the shape is
Hi Nick,
Nick Craig-Wood n...@craig-wood.com writes:
I'd start by writing a function which took (x, y) in array
co-ordinates and transformed that into (z) remapped in the Morton
layout.
This removes the possibility to use the sum() and similar methods of
numpy. Implementing them myself is
Hi again,
I am trying to initialize a class inherited from numpy.ndarray:
from numpy import ndarray
class da(ndarray):
def __init__(self, mydata):
ndarray.__init__(self, 0)
self.mydata = mydata
When I now call the constructor of da:
da(range(100))
I get the message:
Steven D'Aprano st...@remove-this-cybersource.com.au writes:
Perhaps you should post the full trace back instead of just the final
line.
No Problem, although I dont see the information increase there:
In [318]: class da(ndarray):
.: def __init__(self, mydata):
.:
Arnaud Delobelle arno...@googlemail.com writes:
numpy.ndarray has a __new__ method (and no __init__). I guess this is
the one you should override. Try:
What is the difference?
best regards
Ole
--
http://mail.python.org/mailman/listinfo/python-list
Hi John,
John Machin sjmac...@lexicon.net writes:
From my access pattern, it would be probably better to combine 25 rows
into one slice and have one matrix where every cell contains 25 rows.
Are there any objections about that?
Can't object, because I'm not sure what you mean ... how many
Hi John
John Machin sjmac...@lexicon.net writes:
On Apr 25, 1:14 am, Ole Streicher ole-usenet-s...@gmx.net wrote:
John Machin sjmac...@lexicon.net writes:
From my access pattern, it would be probably better to combine 25 rows
into one slice and have one matrix where every cell contains 25
Hi,
for my application, I need to use quite large data arrays
(100.000 x 4000 values) with floating point numbers where I need a fast
row-wise and column-wise access (main case: return a column with the sum
over a number of selected rows, and vice versa).
I would use the numpy array for that,
Hi Nick,
Nick Craig-Wood n...@craig-wood.com writes:
mmaps come out of your applications memory space, so out of that 3 GB
limit. You don't need that much RAM of course but it does use up
address space.
Hmm. So I have no chance to use = 2 of these arrays simultaniously?
Sorry don't know
Hi David,
David Cournapeau courn...@gmail.com writes:
On Fri, Mar 13, 2009 at 8:20 PM, gopal mishra gop...@infotechsw.com wrote:
error: Setup script exited with error: None
Numpy 1.3.0 (to be released 1st April 2009) will contain everything to
be buildable and usable with python 2.6 on
Hi Eduardo,
Eduardo Lenz l...@joinville.udesc.br writes:
On Wednesday 22 April 2009 04:47:54 David Cournapeau wrote:
On Wed, Apr 22, 2009 at 6:38 PM, Ole Streicher ole-usenet-s...@gmx.net
wrote:
but scipy then fails:
error: Lapack (http://www.netlib.org/lapack/) libraries not found
23 matches
Mail list logo