On Thu, 07 Feb 2008 18:22:03 +0100, Diez B. Roggisch
<[EMAIL PROTECTED]> wrote:
> Can you provide an example of what you are actually after? The
> descriptor-protocol might come to use there.
Thanks for your responses. I have read the Descriptor protocol how-to,
which clarifies method access on o
Hello,
I was wondering a bit about the differences between methods and
functions. I have the following:
def wrap(arg):
print type(arg)
return arg
class C:
def f():
pass
@wrap
def g():
pass
def h():
pass
print type(C.f)
print type(h)
Which gives the fol
On Wed, 30 Jan 2008 14:47:36 -0800 (PST), FireNWater <[EMAIL PROTECTED]> wrote:
> I'm curious why the different outputs of this code. If I make the
> dictionary with letters as the keys, they are not listed in the
> dictionary in alphabetical order, but if I use the integers then the
> keys are in
On Wed, 30 Jan 2008 09:57:55 +0100, <[EMAIL PROTECTED]>
<[EMAIL PROTECTED]> wrote:
> How can I convert a string read from a database containing unicode
> literals, such as "Fr\u00f8ya" to the latin-1 equivalent, "Frøya"?
>
> I have tried variations around
> "Fr\u00f8ya".decode('latin-1')
> but
On Tue, 29 Jan 2008 09:23:16 -0800 (PST), [EMAIL PROTECTED]
<[EMAIL PROTECTED]> wrote:
> If you're going to delete elements from
> a list while iterating over it, then do
> it in reverse order:
Why so hard? Reversing it that way creates a copy, so you might as
well do:
>>> a = [ 98, 99, 100 ]
>>>
On Tue, 29 Jan 2008 16:34:17 GMT, William McBrine <[EMAIL PROTECTED]> wrote:
> Look at this -- from Python 2.5.1:
>
a = [1, 2, 3, 4, 5]
for x in a:
> ... if x == 3:
> ... a.remove(x)
> ... print x
> ...
> 1
> 2
> 3
> 5
a
> [1, 2, 4, 5]
You have to iterate over a cop
On Sep 26, 2:31 pm, Bjoern Schliessmann wrote:
> Did you check the return value of gc.collect? Also, try using
> other "insight" facilities provided by the gc module.
gc.collect states it cannot find any unreachable objects. Meanwhile
the number of objects the garbage collector has to keep track o
Hello,
I have programmed some python script that loads a graph (the
mathemical one with vertices and edges) into memory, does some
transformations on it, and then tries to find shortest paths in this
graph, typically several tens of thousands. This works fine.
Then I made a test for this, so I co
On Thu, 28 Jun 2007 09:19:20 + (UTC), Berteun Damman
<[EMAIL PROTECTED]> wrote:
> And that leasts to another question, does Python have a function akin to
> wcwidth() which gives the number of column positions a unicode character
> needs?
After playing around a bit with unicod
Hello,
When using the textwrap module, the wrap will always use len() to
determine the length of the string being wrapped. This might be a
sensible thing to do in many circumstances, but I think there are
circumstances where this does not lead to the desired result.
I assume many applications of
Gabriel Genellina wrote:
> Python got in 2.3 a heapq module in its standard library; I think it is what
> Ah! then I bet:
> - There is some C code involved.
> - It carelessly mixes PyMem_Malloc with PyObject_Free or similar as
> described in
> http://docs.python.org/whatsnew/ports.html
>
> So do y
Hello,
Recently I was looking for a Priority Queue module, and I've found
Pqueue by Andrew Snare [1]. When I use it with Python 2.4 everything
works okay, at least on the two system I've tested it on (Debian based
AMD 64) and OS PPC.
However, when I use it with Python 2.5 - again on the same mach
On Tue, 14 Dec 2004 18:39:19 GMT, Paul McGuire
<[EMAIL PROTECTED]> wrote:
>> If I try however to parse the String "if test; testagain; fi;", it does
>> not work, because the fi is interpreted as an expr, not as the end of
>> the if statement, and of course, adding another fi doesn't solve this
>> e
Hello,
I'm having some problems with pyparsing, I could not find how to tell
it to view certain words as keywords, i.e. not as a possible variable
name (in an elegant way),
for example, I have this little grammar:
terminator = Literal(";")
expr = Word(alphas)
body = Forward();
ifstat = "if" + bod
14 matches
Mail list logo