t; From: Python-list [mailto:python-list-
> bounces+webmailgroups=gmail@python.org] On Behalf Of Steven
> D'Aprano
> Sent: Monday, December 15, 2014 04:01
> To: python-list@python.org
> Subject: Re: Classes - converting external function to class's method.
>
> Thomas 'Poi
Thomas 'PointedEars' Lahn wrote:
> Ivan Evstegneev wrote:
>
>> I have stuck a bit with this example(took this one from the book).
>>
>> Here are a description steps of what I've done till now:
>>
>>
>> Step 1 - creating an empty namespace:
>>
>class rec: pass
>
> IMHO that is not actual
Terry Reedy wrote:
> On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
>> Ivan Evstegneev wrote:
>>> I have stuck a bit with this example(took this one from the book).
>>>
>>> Here are a description steps of what I've done till now:
>>>
>>> Step 1 - creating an empty namespace:
>>>
>> cl
On 12/14/2014 6:15 PM, Thomas 'PointedEars' Lahn wrote:
Ivan Evstegneev wrote:
I have stuck a bit with this example(took this one from the book).
Here are a description steps of what I've done till now:
Step 1 - creating an empty namespace:
class rec: pass
IMHO that is not actually creat
Ivan Evstegneev wrote:
> I have stuck a bit with this example(took this one from the book).
>
> Here are a description steps of what I've done till now:
>
>
> Step 1 - creating an empty namespace:
>
class rec: pass
IMHO that is not actually creating a namespace; it is just
declaring/def
7;Bob'
> age = 40
> def method(obj):
> return obj.name.upper()
Moreover, regard to the "rec.method = uppername"
As I can understand, in this case Python does make some changes to the
function, but they are implicit.
Am I right?
Sincerely,
Ivan
>
Ivan Evstegneev wrote:
> Hello Everyone,
>
> I have stuck a bit with this example(took this one from the book).
The example you are working on (adding external functions as methods) is
actually a bit more complicated than it seems, as you have discovered. You
have this:
class rec: pass
rec.name