On 5/26/2014 4:32 PM, Marko Rauhamaa wrote:
I stand corrected. I had thought the trampoline ("bound method object")
was created once and for all.
Assuming that bound methods are immutable, this is an implementation
detail, either way. However, it is common for a specific method to be
called
On Mon, 26 May 2014 23:58:37 +0300, Marko Rauhamaa wrote:
> Marko Rauhamaa :
>
>> Christian Heimes :
>>
>>> Python creates a new bound method object every time. A bound method
>>> object is a callable object that keeps a strong reference to the
>>> function, class and object. The bound method obj
Marko Rauhamaa wrote:
IOW, you can override a method with setattr() but you cannot delete a
method with delattr().
Actually, you can -- but you need to delete it from
the class, not the instance:
>>> delattr(X, 'f')
>>> x.f()
Traceback (most recent call last):
File "", line 1, in
Attribute
Marko Rauhamaa :
> Christian Heimes :
>
>> Python creates a new bound method object every time. A bound method
>> object is a callable object that keeps a strong reference to the
>> function, class and object. The bound method object adds the object as
>> first argument to the function (aka 'self'
Christian Heimes :
> Python creates a new bound method object every time. A bound method
> object is a callable object that keeps a strong reference to the
> function, class and object. The bound method object adds the object as
> first argument to the function (aka 'self').
I stand corrected. I
On 26.05.2014 21:00, Marko Rauhamaa wrote:
> Terry Reedy :
>
>> Part of the answer is Python's history. Up to about 2.1, most built-in
>> types did not have methods, though I know lists did. Ints and strings
>> did not, or chr and ord might have been int.chr() and str.ord(). (The
>> current string
Terry Reedy :
> Part of the answer is Python's history. Up to about 2.1, most built-in
> types did not have methods, though I know lists did. Ints and strings
> did not, or chr and ord might have been int.chr() and str.ord(). (The
> current string methods were originally functions in the string
>
On 5/26/2014 11:15 AM, Deb Wyatt wrote:
On 5/25/14 7:55 PM, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
How do you know/remember which way to call them?
It can be confusing. Generally, built-in functions (like sum,
>
> On 5/25/14 7:55 PM, Deb Wyatt wrote:
>> I am confused about how various built-in functions are called. Some are
>> called with dot notation
>>
>> How do you know/remember which way to call them?
>>
>> TIA,
>> Deb in WA, USA
>
> It can be confusing. Generally, built-in functions (like sum
On 25May2014 15:55, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
each_item.isalpha()
and some are called like 'normal'
sum(numlist)
How do you know/remember which way to call them?
Documentation.
However, some context:
On 5/25/14 7:55 PM, Deb Wyatt wrote:
I am confused about how various built-in functions are called. Some are
called with dot notation
each_item.isalpha()
and some are called like 'normal'
sum(numlist)
How do you know/remember which way to call them?
TIA,
Deb in WA, USA
It can be confusing
11 matches
Mail list logo