Reject PEP 303.

This commit is contained in:
Raymond Hettinger 2005-06-17 20:19:25 +00:00
parent a6cb759dc8
commit 550eee19ee
2 changed files with 18 additions and 3 deletions

View File

@ -92,7 +92,6 @@ Index by Category
S 298 The Locked Buffer Interface Heller
S 299 Special __main__() function in modules Epler
S 302 New Import Hooks JvR
S 303 Extend divmod() for Multiple Divisors Bellman
S 304 Controlling Generation of Bytecode Files Montanaro
S 310 Reliable Acquisition/Release Pairs Hudson, Moore
S 312 Simple Implicit Lambda Suzi, Martelli
@ -205,6 +204,7 @@ Index by Category
SR 288 Generators Attributes and Exceptions Hettinger
SR 295 Interpretation of multiline string constants Koltsov
SR 296 Adding a bytes Object Type Gilbert
SR 303 Extend divmod() for Multiple Divisors Bellman
SR 308 If-then-else expression GvR, Hettinger
SR 313 Adding Roman Numeral Literals to Python Meyer
SD 316 Programming by Contract for Python Way
@ -344,7 +344,7 @@ Numerical Index
S 299 Special __main__() function in modules Epler
SF 301 Package Index and Metadata for Distutils Jones
S 302 New Import Hooks JvR
S 303 Extend divmod() for Multiple Divisors Bellman
SR 303 Extend divmod() for Multiple Divisors Bellman
S 304 Controlling Generation of Bytecode Files Montanaro
SF 305 CSV File API Montanaro, et al
I 306 How to Change Python's Grammar Hudson

View File

@ -3,7 +3,7 @@ Title: Extend divmod() for Multiple Divisors
Version: $Revision$
Last-Modified: $Date$
Author: Thomas Bellman <bellman+pep-divmod@lysator.liu.se>
Status: Draft
Status: Rejected
Type: Standards Track
Content-Type: text/plain
Created: 31-Dec-2002
@ -17,6 +17,21 @@ Abstract
allowing it to take multiple divisors, chaining several calls to
divmod() into one.
Pronouncement
This PEP is rejected. Most uses for chained divmod() involve a
constant modulus (in radix conversions for example) and are more
properly coded as a loop. The example of splitting seconds
into days/hours/minutes/seconds does not generalize to months
and years; rather, the whole use case is handled more flexibly and
robustly by date and time modules. The other use cases mentioned
in the PEP are somewhat rare in real code. The proposal is also
problematic in terms of clarity and obviousness. In the examples,
it is not immediately clear that the argument order is correct or
that the target tuple is of the right length. Users from other
languages are more likely to understand the standard two argument
form without having to re-read the documentation. See python-dev
discussion on 17 June 2005.
Specification