Adopt Jack Diederich's suggested module name.
This commit is contained in:
parent
5b706be0c0
commit
6c168af9b0
10
pep-0329.txt
10
pep-0329.txt
|
@ -52,7 +52,7 @@ and performance will improve across the board.
|
|||
Proposal
|
||||
========
|
||||
|
||||
Add a module called codetweaks.py which contains two functions,
|
||||
Add a module called pragma.py which contains two functions,
|
||||
`bind_constants()` and `bind_all()`. The first function performs
|
||||
constant binding and the second recursively applies it to every
|
||||
function and class in a target module.
|
||||
|
@ -60,8 +60,8 @@ function and class in a target module.
|
|||
For most modules in the standard library, add a pair of lines near
|
||||
the end of the script::
|
||||
|
||||
import codetweaks, sys
|
||||
codetweaks.bind_all(sys.modules[__name__])
|
||||
import pragma, sys
|
||||
pragma.bind_all(sys.modules[__name__])
|
||||
|
||||
In addition to binding builtins, there are some modules (like
|
||||
`sre_compile`) where it also makes sense to bind module variables
|
||||
|
@ -114,7 +114,7 @@ Questions and Answers
|
|||
implementations?
|
||||
|
||||
Either do this before importing a module, or just reload the
|
||||
module, or disable `codetweaks.py` (it will have a disable flag).
|
||||
module, or disable `pragma.py` (it will have a disable flag).
|
||||
|
||||
8. How susceptible is this module to changes in Python's byte coding?
|
||||
|
||||
|
@ -135,7 +135,7 @@ Questions and Answers
|
|||
Sample Implementation
|
||||
=====================
|
||||
|
||||
Here is a sample implementation for codetweaks.py::
|
||||
Here is a sample implementation for pragma.py::
|
||||
|
||||
from types import ClassType, FunctionType
|
||||
from opcode import opmap, HAVE_ARGUMENT, EXTENDED_ARG
|
||||
|
|
Loading…
Reference in New Issue