[Python-Dev] PEP 343 and context() (original) (raw)
Jason Orendorff jason.orendorff at gmail.com
Fri Jan 20 04:41:23 CET 2006
- Previous message: [Python-Dev] Additions to the functional module
- Next message: [Python-Dev] PEP 343 and __context__()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I just noticed that my name is in PEP 343 attached to the idea of the context() method, and I'm slightly queasy over it.
The rationale was to help e.g. decimal.DecimalContext support 'with'. Maybe that's a bad idea.
DecimalContext has a few problems. In code where it matters, every function you write has to worry about it. (That is, you can't just write decimal_context = ... at the top of the file and be done with it, the way you can with, say, metaclass.) And DecimalContext doesn't fit in with generators.
sys.stdout has similar problems.
It feels like PEP 343 will make people want to follow this model. That is, we'll see more global behavior-controlling variables in the future. There are grizzlier fates; I just wondered if anyone had thought of this.
Cheers, -j
- Previous message: [Python-Dev] Additions to the functional module
- Next message: [Python-Dev] PEP 343 and __context__()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]