Classes as namespaces?

Luis M. González luismgz at gmail.com
Fri Mar 26 19:26:04 CET 2010


On 26 mar, 11:49, kj <no.em... at please.post> wrote:
> What's the word on using "classes as namespaces"?  E.g.
>
> class _cfg(object):
>     spam = 1
>     jambon = 3
>     huevos = 2
>
> breakfast = (_cfg.spam, _cfg.jambon, _cfg.huevos)

I see no problem.
I wouldn't mix English, French and Spanish in the same recipe though...



More information about the Python-list mailing list