Dynamically call methods where method is known by address vs name

Malcolm Greene python at bdurham.com
Fri Jul 22 17:04:59 EDT 2016


Hi Michael,
 
> Out[3]: 'HELLO'
> In [4]: g = str.upper
> In [5]: g(s)
> Out[5]: 'HELLO'
 
That's perfect! My mistake was trying to use the method returned by
''.upper vs. str.upper.
 
Thank you,
Malcolm
 



More information about the Python-list mailing list