Message118194
That is what we are using now, but I think a contextlib.null() would be useful to others, i.e. that its use is a useful idiom to adopt. Specifically I would like to discourage the "duplicated code" idiom from the report, which I've seen all too often.
The "closing" constructor is also trivial to define, but it's there for convenience and to promote the use of with statement over try/finally boilerplate. The same goes here: you don't miss the null context manager when you don't have it; you invent other solutions. But when it's already available, it's an elegant pattern. In my experience, if they have to define it to get it, most people won't bother with the pattern and will retain less elegant solutions. |
|
Date |
User |
Action |
Args |
2010-10-08 12:04:39 | hniksic | set | recipients:
+ hniksic, ncoghlan, pitrou, vstinner, eric.araujo, michael.foord |
2010-10-08 12:04:39 | hniksic | set | messageid: <1286539479.65.0.17583535299.issue10049@psf.upfronthosting.co.za> |
2010-10-08 12:04:38 | hniksic | link | issue10049 messages |
2010-10-08 12:04:37 | hniksic | create | |
|