What could 'f(this:that=other):' mean?

Nick Coghlan ncoghlan at iinet.net.au
Sat Jan 8 00:06:44 EST 2005


If the caller is meant to supply a namespace, get them to supply a namespace.

def f(ns1, ns2):
   print ns1['a'], ns1['b'], ns2['a'], ns2['b']

f(ns1 = dict(a=1, b=2), ns2 = dict(a=3, b=4))

Hey, where's Steve? Maybe his generic objects should be called namespaces 
instead of bunches. . .

def f(ns1, ns2):
   print ns1.a, ns1.b, ns2.a, ns2.b

f(ns1 = namespace(a=1, b=2), ns2 = namespace(a=3, b=4))

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at email.com   |   Brisbane, Australia
---------------------------------------------------------------
             http://boredomandlaziness.skystorm.net



More information about the Python-list mailing list