Am 28.02.2010 15:08, schrieb Alf P. Steinbach:
 >>> "Hello".upper
<built-in method upper of str object at 0x00BA16E0>
 >>> f = "Hello".upper
 >>> f
<built-in method upper of str object at 0x00BA16E0>
 >>> f()
   'HELLO'
 >>>
 >>>
 >>>
 >>> f.__self__
   'Hello'

Holy hand grenade.
You have no Idea how enlightened I feel right now :D

Thank you, "bound method" was the term I forgot and your example... ...totally revealed the internals behind this to me. Especially the last line I quoted.
I mean, I always knew *that* this works, but I never knew *why*.

Regards,
Michael
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to