Self reject PEP 329.
This commit is contained in:
parent
6c168af9b0
commit
d8f2eaf03c
|
@ -123,7 +123,6 @@ Index by Category
|
|||
S 324 popen5 - New POSIX process module Astrand
|
||||
S 325 Resource-Release Support for Generators Pedroni
|
||||
S 327 Decimal Data Type Batista
|
||||
S 329 Treating Builtins as Constants in the Standard Library Hettinger
|
||||
S 754 IEEE 754 Floating Point Special Values Warnes
|
||||
|
||||
Finished PEPs (done, implemented in CVS)
|
||||
|
@ -195,6 +194,7 @@ Index by Category
|
|||
SD 316 Programming by Contract for Python Way
|
||||
SR 317 Eliminate Implicit Exception Instantiation Taschuk
|
||||
SR 326 A Case for Top and Bottom Values Carlson, Reedy
|
||||
SR 329 Treating Builtins as Constants in the Standard Library Hettinger
|
||||
SR 666 Reject Foolish Indentation Creighton
|
||||
|
||||
|
||||
|
@ -350,7 +350,7 @@ Numerical Index
|
|||
SR 326 A Case for Top and Bottom Values Carlson, Reedy
|
||||
S 327 Decimal Data Type Batista
|
||||
SA 328 Imports: Multi-Line and Absolute/Relative Aahz
|
||||
S 329 Treating Builtins as Constants in the Standard Library Hettinger
|
||||
SR 329 Treating Builtins as Constants in the Standard Library Hettinger
|
||||
SR 666 Reject Foolish Indentation Creighton
|
||||
S 754 IEEE 754 Floating Point Special Values Warnes
|
||||
|
||||
|
|
19
pep-0329.txt
19
pep-0329.txt
|
@ -3,7 +3,7 @@ Title: Treating Builtins as Constants in the Standard Library
|
|||
Version: $Revision$
|
||||
Last-Modified: $Date$
|
||||
Author: Raymond Hettinger <python at rcn.com>
|
||||
Status: Draft
|
||||
Status: Rejected
|
||||
Type: Standards Track
|
||||
Content-Type: text/x-rst
|
||||
Created: 18-Apr-2004
|
||||
|
@ -11,6 +11,13 @@ Python-Version: 2.4
|
|||
Post-History: 18-Apr-2004
|
||||
|
||||
|
||||
Status
|
||||
======
|
||||
|
||||
The PEP is self rejected by the author due to the unprecedented
|
||||
level of enmity it generated from developers.
|
||||
|
||||
|
||||
Abstract
|
||||
========
|
||||
|
||||
|
@ -52,7 +59,7 @@ and performance will improve across the board.
|
|||
Proposal
|
||||
========
|
||||
|
||||
Add a module called pragma.py which contains two functions,
|
||||
Add a module called codetweaks.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 +67,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 pragma, sys
|
||||
pragma.bind_all(sys.modules[__name__])
|
||||
import codetweaks, sys
|
||||
codetweaks.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 +121,7 @@ Questions and Answers
|
|||
implementations?
|
||||
|
||||
Either do this before importing a module, or just reload the
|
||||
module, or disable `pragma.py` (it will have a disable flag).
|
||||
module, or disable `codetweaks.py` (it will have a disable flag).
|
||||
|
||||
8. How susceptible is this module to changes in Python's byte coding?
|
||||
|
||||
|
@ -135,7 +142,7 @@ Questions and Answers
|
|||
Sample Implementation
|
||||
=====================
|
||||
|
||||
Here is a sample implementation for pragma.py::
|
||||
Here is a sample implementation for codetweaks.py::
|
||||
|
||||
from types import ClassType, FunctionType
|
||||
from opcode import opmap, HAVE_ARGUMENT, EXTENDED_ARG
|
||||
|
|
Loading…
Reference in New Issue