>>> > + def env(self):
>>> > + return [(env.lstrip('env:'), value)
>>> > + for env, value in
>>> > self.gateway.spec.__dict__.iteritems()
>>> > + if env.startswith('env:')]
>>> >
>
>> You could use env[4:] instead of lstrip() to optimize though :)
>
>
> using [:4] instead of lstrip is not much about performance, but about
> correctness:
>
>>>> 'env:env'.lstrip('env:')
> ''
True, I somehow forgot strip removes chars not whole string.
_
jakub
_______________________________________________
py-dev mailing list
[email protected]
http://codespeak.net/mailman/listinfo/py-dev