| CARVIEW |
Select Language
HTTP/2 200
server: nginx
date: Tue, 23 Dec 2025 23:13:28 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Thu, 28 Jan 2010 03:11:11 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "1688738698f632f45b68a17c1b416660"
x-archive-orig-x-runtime: 163ms
x-archive-orig-content-length: 23755
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Thu, 28 Jan 2010 03:11:11 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_14_20100128024205_crawl100-c/52_14_20100128030955_crawl101.arc.gz
server-timing: captures_list;dur=0.793635, exclusion.robots;dur=0.079369, exclusion.robots.policy;dur=0.066603, esindex;dur=0.010076, cdx.remote;dur=5.025075, LoadShardBlock;dur=170.658822, PetaboxLoader3.datanode;dur=126.338905, PetaboxLoader3.resolve;dur=208.001841, load_resource;dur=210.683883
x-app-server: wwwb-app243-dc6
x-ts: 200
x-tr: 474
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=1
set-cookie: wb-p-SERVER=wwwb-app243; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
rfk's withhacks at master - GitHub
This service is courtesy of Pledgie.
rfk / withhacks
- Source
- Commits
- Network (1)
- Issues (0)
- Downloads (2)
- Wiki (1)
- Graphs
-
Branch:
master
-
Branches (1)
- master ✓
- Tags (2)
Sending Request…
Enable Donations
Pledgie Donations
Once activated, we'll place the following badge in your repository's detail box:
building blocks for with-statement-related hackery — Read more
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Jan 19 15:15:28 -0800 2010 | initial commit [rfk] |
| |
ChangeLog.txt | Fri Jan 22 04:46:36 -0800 2010 | better name lookup algo in namespace() and keys... [rfk] |
| |
LICENSE.txt | Tue Jan 19 15:15:28 -0800 2010 | initial commit [rfk] |
| |
MANIFEST.in | Tue Jan 19 15:15:28 -0800 2010 | initial commit [rfk] |
| |
README.txt | Tue Jan 19 19:23:05 -0800 2010 | fix typo in docstring [rfk] |
| |
setup.py | Tue Jan 19 19:14:21 -0800 2010 | add version info and adjust setup.py script [rfk] |
| |
withhacks/ | Fri Jan 22 21:55:54 -0800 2010 | move name-loading functionality into frameutils... [rfk] |
README.txt
withhacks: building blocks for with-statement-related hackery This module is a collection of useful building-blocks for hacking the Python "with" statement. It combines ideas from several neat with-statement hacks I found around the internet into a suite of re-usable components: * https://www.mechanicalcat.net/richard/log/Python/Something_I_m_working_on.3 * https://billmill.org/multi_line_lambdas.html * https://code.google.com/p/ouspg/wiki/AnonymousBlocksInPython By subclassing the appropriate context managers from this module, you can easily do things such as: * skip execution of the code inside the with-statement * set local variables in the frame executing the with-statement * capture the bytecode from inside the with-statement * capture local variables defined inside the with-statement Building on these basic tools, this module also provides some useful prebuilt hacks: :xargs: call a function with additional arguments defined in the body of the with-statement :xkwargs: call a function with additional keyword arguments defined in the body of the with-statement :namespace: direct all variable accesses and assignments to the attributes of a given object (like "with" in JavaScript or VB) :keyspace: direct all variable accesses and assignments to the keys of of a given object (like namespace() but for dicts) WithHacks makes extensive use of Noam Raphael's fantastic "byteplay" module; since the official byteplay distribution doesn't support Python 2.6, a local version with appropriate patches is included in this module.
