[Python-checkins] CVS: python/nondist/peps pep-0238.txt,1.14,1.15

Guido van Rossum gvanrossum@users.sourceforge.net
Mon, 06 Aug 2001 19:52:39 -0700


Update of /cvsroot/python/python/nondist/peps
In directory usw-pr-cvs1:/tmp/cvs-serv23368

Modified Files:
	pep-0238.txt 
Log Message:
Discuss x \ y as rejected variation; reorganize the section on
variations slightly to allow more easily adding new variations.

Add more discussion of why I don't like version directives.


Index: pep-0238.txt
===================================================================
RCS file: /cvsroot/python/python/nondist/peps/pep-0238.txt,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** pep-0238.txt	2001/08/01 16:03:14	1.14
--- pep-0238.txt	2001/08/07 02:52:37	1.15
***************
*** 125,135 ****
  
      Aesthetically, x//y doesn't please everyone, and hence several
!     variations have been proposed: x div y, or div(x, y), sometimes in
!     combination with x mod y or mod(x, y) as an alternative spelling
!     for x%y.
! 
!     We consider these solutions inferior, on the following grounds.
  
!     - Using x div y would introduce a new keyword.  Since div is a
        popular identifier, this would break a fair amount of existing
        code, unless the new keyword was only recognized under a future
--- 125,131 ----
  
      Aesthetically, x//y doesn't please everyone, and hence several
!     variations have been proposed.  They are addressed here:
  
!     - x div y.  This would introduce a new keyword.  Since div is a
        popular identifier, this would break a fair amount of existing
        code, unless the new keyword was only recognized under a future
***************
*** 141,145 ****
        this.
  
!     - Using div(x, y) makes the conversion of old code much harder.
        Replacing x/y with x//y or x div y can be done with a simple
        query replace; in most cases the programmer can easily verify
--- 137,141 ----
        this.
  
!     - div(x, y).  This makes the conversion of old code much harder.
        Replacing x/y with x//y or x div y can be done with a simple
        query replace; in most cases the programmer can easily verify
***************
*** 152,155 ****
--- 148,156 ----
        placement of the "div(" and ")" part can be decided.
  
+     - x \ y.  The backslash is already a token, meaning line
+       continuation, and in general it suggests an "escape" to Unix
+       eyes.  In addition (this due to terry Reedy) this would make
+       things like eval("x\y") harder to get right.
+ 
  
  Alternatives
***************
*** 191,195 ****
        do so for multiple versions within the same interpreter.  This
        is way too much work.  A much simpler solution is to keep
!       multiple interpreters installed.
  
  
--- 192,201 ----
        do so for multiple versions within the same interpreter.  This
        is way too much work.  A much simpler solution is to keep
!       multiple interpreters installed.  Another argument against this
!       is that the version directive is almost always overspecified:
!       most code written for Python X.Y, works for Python X.(Y-1) and
!       X.(Y+1) as well, so specifying X.Y as a version is more
!       constraining than it needs to be.  At the same time, there's no
!       way to know at which future or past version the code will break.