[EMAIL PROTECTED] writes:
> Currently I'm just putting this at the top of the file:
>
> py=1
> funcpre=2
> funcpost=3
> ...
That can be done more compactly with
py, funcpre, funcpost = range(3)
give or take 1.
> but I'm curious if there's a better way of doing this,
[EMAIL PROTECTED] wrote:
> I currently have a 2-dim hash, indexed by two strings:
>
> template['py']['funcpre']
> template['py']['funcpost']
> ...
>
> but I would prefer to have these indexed by constants of
> some kind, since this seems a bit more natural:
>
> template[py][func
> > [enums snip]
> Thus, those names are all bound to unique objects, that won't be
> unexpectedly duplicated by some other value.
>
> > but I'm curious if there's a better way of doing this, some kind of
> > enum-like thing or somesuch.
>
> Please try the 'enum' package in the Cheeseshop:
Am I th
[EMAIL PROTECTED] writes:
> Currently I'm just putting this at the top of the file:
>
> py=1
> funcpre=2
> funcpost=3
> ...
Slightly better is:
py = object()
funcpre = object()
funcpost = object()
Thus, those names are all bound to unique objects, that won't be
unex
I currently have a 2-dim hash, indexed by two strings:
template['py']['funcpre']
template['py']['funcpost']
...
but I would prefer to have these indexed by constants of
some kind, since this seems a bit more natural:
template[py][funcpre]
template[py][funcpost]
...
Curre