c[:]()

Douglas Woodrow newsgroups at nospam.demon.co.uk
Thu May 31 03:57:56 EDT 2007


On Wed, 30 May 2007 23:23:22, Warren Stringer <warren at muse.com> wrote
>
>def a(): return 'b'
>def b(): print 'polly! wakey wakey'
>c = {}
>c['a'] = b
>c[a()]()  #works!


(typo correction for other easily-confused newbies like myself)

I think you mean
,----
| c['a']()  #works!
`----

-- 
Doug Woodrow




More information about the Python-list mailing list