Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #21007 > unrolled thread
| Started by | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| First post | 2012-02-28 22:12 +0000 |
| Last post | 2012-02-28 22:12 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
RE: alternative to with statement? "Prasad, Ramit" <ramit.prasad@jpmorgan.com> - 2012-02-28 22:12 +0000
| From | "Prasad, Ramit" <ramit.prasad@jpmorgan.com> |
|---|---|
| Date | 2012-02-28 22:12 +0000 |
| Subject | RE: alternative to with statement? |
| Message-ID | <mailman.264.1330467191.3037.python-list@python.org> |
Craig Yoshioka wrote: >I see that there was previously a PEP to allow the with statement to skip the enclosing block... this was shot down, and I'm trying to think of the most elegant alternative. [..] >I would have really liked: >with cachingcontext(x): > # create cached resources here ># return cached resources Is this a common pattern? I thought the point of the context manager was to remove create and close the resources (like with file opening). Seems slightly odd to use just for creation...but maybe only because I have never used it like that. Ramit Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology 712 Main Street | Houston, TX 77002 work phone: 713 - 216 - 5423 -- This email is confidential and subject to important disclaimers and conditions including on offers for the purchase or sale of securities, accuracy and completeness of information, viruses, confidentiality, legal privilege, and legal entity disclaimers, available at http://www.jpmorgan.com/pages/disclosures/email.
Back to top | Article view | comp.lang.python
csiph-web