Dear Experts,
How do I reassign self to another object? For example, I want something like
class foo:
def Update(self,other):
# make this object the same as other or make this object a copy of
other
self = other # This won't work. What I really want is *this = other
in C++ termi
r way...
Thanks,
-Emin
On 6/1/07, Carsten Haese <[EMAIL PROTECTED]> wrote:
On Fri, 2007-06-01 at 11:30 -0400, Emin.shopper Martinian.shopper wrote:
> Dear Experts,
>
> How do I reassign self to another object? For example, I want
> something like
>
> class foo:
> def Upda
Dear Experts,
How does one use pdb and doctest.testmod(raise_on_error=True)? What I would
like to happen is that when a doctest fails (e.g., by raising an exception),
I can do import pdb; pdb.pm() to figure out what went wrong. But when I do
pdb.pm() I end up in doctest.DebugRunner.report_unexpec
Dear Experts,
What is the preferred doc extraction tool for python? It seems that there
are many very nice options (e.g., pydoc, epydoc, HappyDoc, and lots of
others), but what is the "standard" tool or at least what is the tool used
to generate the documentation for the python standard library?
Googling for "profiling python extensions" leads to the following link which
worked for me a while ago:
http://plexity.blogspot.com/2006/02/profiling-python-extensions.html
On 7/10/07, rasmus <[EMAIL PROTECTED]> wrote:
I have used gprof to profile stand alone C++ programs. I am also
aware of p
Dear Experts,
How do you use pdb to debug when a TestCase object from the unittest module
fails? Basically, I'd like to run my unit tests and invoke pdb.pm when
something fails.
I tried the following with now success:
Imagine that I have a module _test.py that looks like the following:
---
()
File "c:\python25\lib\pdb.py", line 1148, in pm
post_mortem(sys.last_traceback)
AttributeError: 'module' object has no attribute 'last_traceback'
On 7/18/07, Jean-Paul Calderone <[EMAIL PROTECTED]> wrote:
On Wed, 18 Jul 2007 16:40:46 -0400, "Emin.sh
seems like an ugly hack and I would think there is
a better solution...
Thanks,
-Emin
On 7/18/07, Emin.shopper Martinian.shopper <[EMAIL PROTECTED]> wrote:
Thanks for the reply, but neither of those work for me. I don't seem to
have the "trial" program installed. Where
Dear Experts,
There seem to be multiple versions of python modes for emacs? Could someone
point me to the mainterers of either the "official" one or the one that is
being maintained most vigorously?
I've tried both python.el and python-mode.el. Both seem to have various
minor foibles which I'd be
Dear Experts,
Does anyone know how you can either make pylint "see" setattr or give it
explicit information when you do a "compile time" call to setattr?
For example, imagine that I have the following block of code
class foo:
def __init__(self):
for i in [1,2,5]:
setattr(s
Dear Experts,
I love the pickle module, but I occasionally have problems pickling a
function. For example, if I create an instance g of class f and assign
g.xto a function, then I cannot pickle g (example code below). I know
that I
can pickle f separately if I want to, and I understand why I get t
On Dec 12, 2007 11:48 AM, Calvin Spealman <[EMAIL PROTECTED]>
wrote:
> On Dec 12, 2007, at 11:01 AM, Emin.shopper Martinian.shopper wrote:
>
> > But is there a way to assign functions to instances of a class
> > without preventing pickleability? It doesn't seem unre
Dear Experts,
Is there any hope of a parallel processing toolkit being incorporated into
the python standard library? I've seen a wide variety of toolkits each with
various features and limitations. Unfortunately, each has its own API. For
coarse-grained parallelism, I suspect I'd be pretty happy
On Dec 27, 2007 4:13 PM, Robert Kern <[EMAIL PROTECTED]> wrote:
> Emin.shopper Martinian.shopper wrote:
> > If not, is there any hope of something like
> > the db-api for coarse grained parallelism (i.e, a common API that
> > different toolkits can support)?
>
Dear Experts,
How do you pass the -c option to setup.py install? Specifically, when I try
to install zope.interfaces version 3.3 from source on a windows machine, I
get a message about using "-c mingw32". That works fine for setup.py build,
but it does not work for "setup.py install".
Note: I wou
On Jan 3, 2008 11:24 AM, Emin.shopper Martinian.shopper <
[EMAIL PROTECTED]> wrote:
> How do you pass the -c option to setup.py install?
After some fiddling, I figured out that you can put the following two lines
in setup.cfg:
[build]
compiler=mingw32
It would be nice if you coul
Dear Experts,
Is there a good way to choose/assign random dynamic port numbers in python?
I had in mind something like the following, but if multiple programs are
generating random port numbers, is there a way to check if a given port
number is already taken?
def GenerateDynamicPortNumber():
Dear Experts,
I am having some issues with the subprocess module and how it
interacts with win32security.ImpersonateLoggedOnUser. Specifically, I
use the latter to change users but the new user does not seem to be
properly inherited when I spawn further subprocesses.
I am doing something like
Thanks. But how do I fix this so that the subprocess does inherit the
impersonated stuff?
On Mon, Jun 1, 2009 at 9:38 AM, Tim Golden wrote:
> Emin.shopper Martinian.shopper wrote:
>>
>> Dear Experts,
>>
>> I am having some issues with the subprocess module a
> The source for subprocess just uses CreateProcess. Which means that,
> short of monkey-patching it, you're going to have to roll your own
> subprocess-like code (I think). Basically, you'll need to run
> CreateProcessAsUser or CreateProcessAsLogonW. They're both a bit
> of a pig in terms of getti
I am pleased to announce the release of superpy 1.2.1 available from
http://code.google.com/p/superpy.
As this is the first announcement of superpy, any comments and
feedback would be much appreciated.
--
Superpy distributes python programs across a cluster of machines or
across
Dear Experts,
I am getting a MemoryError when creating a dict in a long running
process and suspect this is due to memory fragmentation. Any
suggestions would be welcome. Full details of the problem are below.
I have a long running processing which eventually dies to a
MemoryError exception. When
On Thu, Jun 3, 2010 at 7:41 PM, dmtr wrote:
> On Jun 3, 3:43 pm, "Emin.shopper Martinian.shopper"
> wrote:
>> Dear Experts,
>>
>
> Are you sure you have enough memory available?
> Dict memory usage can jump x2 during re-balancing.
>
I'm pretty sur
On Thu, Jun 3, 2010 at 10:00 PM, dmtr wrote:
> I'm still unconvinced that it is a memory fragmentation problem. It's
> very rare.
You could be right. I'm not an expert on python memory management. But
if it isn't memory fragmentation, then why is it that I can create
lists which use up 600 more M
Dear Dmitry, Bryan and Philip,
Thanks for the suggestions. I poked around the dictionary descriptions
and fiddled some more but couldn't find any obvious error. I agree it
does seem odd that a 50 kb dict should fail. Eventually, I tried
Dmitry suggestion of moving over to python 2.6. This took a w
25 matches
Mail list logo