Bruno Desthuilliers wrote:
> Mathias Panzenboeck a écrit :
>
> About the lost weakref problem: in Python, methods are just tiny
> wrappers around the object, class and function created at lookup time
> (yes, on *each* lookup) (and WWAI, they are by the function object
> itself
Alex Martelli wrote:
> Mathias Panzenboeck <[EMAIL PROTECTED]> wrote:
>
>> Marc 'BlackJack' Rintsch wrote:
>>> ``del b`` just deletes the name `b`. It does not delete the object.
>>> There's still the name `_` bound to it in the interactive int
Marc 'BlackJack' Rintsch wrote:
> ``del b`` just deletes the name `b`. It does not delete the object.
> There's still the name `_` bound to it in the interactive interpreter.
> `_` stays bound to the last non-`None` result in the interpreter.
>
Actually I have the opposite problem. The referen
Marc 'BlackJack' Rintsch wrote:
> On Sun, 07 Oct 2007 16:51:33 +0200, Mathias Panzenboeck wrote:
>
>> import weakref
>>
>> class Wrapper(object):
>> def __init__(self,x):
>> self.x = weakref.ref(x)
>>
>> def
When I change the class Wrapper to following, the class Foo works:
class Wrapper(object):
def __init__(self,x):
self.func_name = x.func_name
self.x = weakref.ref(x.im_self)
def __call__(self,*args,**kwargs):
x = self.x()
Hi.
I have a problem with weak refs and bound methods. The best explanation for the
problem is a short bit of code. I have the three classes Wrapper, Foo and Bar:
import weakref
class Wrapper(object):
def __init__(self,x):
self.x = weakref.ref(x)
def __call__(sel
Steve Howell schrieb:
> --- "[EMAIL PROTECTED]"
> <[EMAIL PROTECTED]> wrote:
>
>> Is there a resource somewhere on the net that can be
>> used to quickly
>> and effectively show Python's strengths to
>> non-Python programmers?
>> Small examples that will make them go "Wow, that
>> _is_ neat"?
>>
>
Fredrik Lundh schrieb:
> Danny Colligan wrote:
>
>> Carsten mentioned that generators are more memory-efficient to use when
>> dealing with large numbers of objects. Is this the main advantage of
>> using generators? Also, in what other novel ways are generators used
>> that are clearly superior
A other great thing: With rpy you have R bindings for python.
So you have the power of R and the easy syntax and big standard lib of python!
:)
--
http://mail.python.org/mailman/listinfo/python-list
Neil Toronto wrote:
>
> 2) Is there any way to restrict Python modules from accessing files
> outside of a sandbox?
>
As far as I heard, there is no really working way. But maybe that has changed
in python 2.5? Or it
will in 3.0? I dunno.
--
http://mail.python.org/mailman/listinfo/python-list
Bruno Desthuilliers wrote:
> Mathias Panzenboeck a écrit :
>> Rob Thorpe wrote:
>>
>>> Mathias Panzenboeck wrote:
>>>
>>>> Mark Tarver wrote:
>>>>
>>>>> How do you compare Python to Lisp? What specific advantages do you
&g
Anthony Baxter wrote:
> On 12/13/06, Holger Joukl <[EMAIL PROTECTED]> wrote:
>> I did read this but didn't think it applied to my situation. I'm quite
>> sure that the refcount of the local variable is 1 before the local scope
>> is left.
>> So let me rephrase the question: Even if I can make sure
Rob Thorpe wrote:
> Mathias Panzenboeck wrote:
>> Mark Tarver wrote:
>>> How do you compare Python to Lisp? What specific advantages do you
>>> think that one has over the other?
>>>
>>> Note I'm not a Python person and I have no axes to grind
Mark Tarver wrote:
> How do you compare Python to Lisp? What specific advantages do you
> think that one has over the other?
>
> Note I'm not a Python person and I have no axes to grind here. This is
> just a question for my general education.
>
> Mark
>
I do not know much about Lisp. What I
Chris Mellon wrote:
> On 11/29/06, Tom Plunket <[EMAIL PROTECTED]> wrote:
>> I'd like to figure out if a given parameter is a function or not.
>>
>> E.g.
>>
>> >>> type(1)
>>
>> >>> type(1) == int
>> True
>>
>> implies:
>>
>> >>> def foo():
>> ... pass
>> ...
>> >>> type(foo)
>>
>> >>> type(foo
Robert Kern wrote:
> Timothy Wu wrote:
>> Hi,
>>
>> Using generator recursively is not doing what I expect:
>>
>> def test_gen(x):
>> yield x
>> x = x - 1
>> if x != 0:
>> test_gen(x)
>
> The only thing that the last line does is *create* a new generator object. You
> need to a
Fredrik Lundh wrote:
> Mathias Panzenboeck wrote:
>
>> But the question is: *IS* this derived work? I mean, it's not copied
>> code.
>> It's the same hashing-logic, which I learned by watching pythons code.
>
> given that it's only a few lines of
Paul Rubin wrote:
> Mathias Panzenboeck <[EMAIL PROTECTED]> writes:
>> So, can this code be considered as derived and do I have to put my
>> code under the GPL? I'd like to publish it under something less
>> restrictive, like a BSD style license. But if GPL is
Hi.
I wrote a small hashlib for C. Because I'm new to hashes I looked at pythons
implementation and
reused *some* of the code... or more the mathematical "hash-function", not
really the code.
In particular I looked at pythons hash and lookup functions, so I came up with
this (see the code
un
I wrote a few functions which IMHO are missing in python(s itertools).
You can download them here:
http://sourceforge.net/project/showfiles.php?group_id=165721&package_id=212104
A short description to all the functions:
icmp(iterable1, iterable2) -> integer
Return negative if iterable1 <
20 matches
Mail list logo