]> granicus.if.org Git - python/commitdiff
Get rid of 'file' built-in. Get rid of types.StringType and friends.
authorGuido van Rossum <guido@python.org>
Tue, 8 May 2007 17:20:32 +0000 (17:20 +0000)
committerGuido van Rossum <guido@python.org>
Tue, 8 May 2007 17:20:32 +0000 (17:20 +0000)
Lib/site.py
Lib/types.py
Python/bltinmodule.c

index c4e0d514a41bf8a224d2efe528e3bf05f95fbe5d..ba8603c9307e19cae6b39c3e2ab90cc302e4ac46 100644 (file)
@@ -414,9 +414,7 @@ def installnewio():
         def __new__(cls, *args, **kwds):
             return io.open(*args, **kwds)
     __builtin__.classic_open = __builtin__.open
-    __builtin__.classic_file = __builtin__.file
     __builtin__.open = open
-    __builtin__.file = open
     sys.stdin = io.open(0, "r")
     sys.stdout = io.open(1, "w")
     sys.stderr = io.open(2, "w")
index 3c1c9390d7e228099ff0d41282408c92a1806830..1d90012d9ed572d52af416ed6ee2f73c99e46e91 100644 (file)
@@ -22,17 +22,6 @@ try:
 except NameError:
     pass
 
-StringType = str
-
-# StringTypes is already outdated.  Instead of writing "type(x) in
-# types.StringTypes", you should use "isinstance(x, basestring)".  But
-# we keep around for compatibility with Python 2.2.
-try:
-    UnicodeType = str
-    StringTypes = (StringType, UnicodeType)
-except NameError:
-    StringTypes = (StringType,)
-
 BufferType = buffer
 
 TupleType = tuple
@@ -62,7 +51,6 @@ BuiltinFunctionType = type(len)
 BuiltinMethodType = type([].append)     # Same as BuiltinFunctionType
 
 ModuleType = type(sys)
-FileType = file
 
 try:
     raise TypeError
index 46fbf777f4f14feb84629d6cb6f5181cbf16343d..264470b1c694f7d74b3afbcd365288268b2a8e5c 100644 (file)
@@ -2040,7 +2040,6 @@ _PyBuiltin_Init(void)
 #endif
        SETBUILTIN("dict",              &PyDict_Type);
        SETBUILTIN("enumerate",         &PyEnum_Type);
-       SETBUILTIN("file",              &PyFile_Type);
        SETBUILTIN("float",             &PyFloat_Type);
        SETBUILTIN("frozenset",         &PyFrozenSet_Type);
        SETBUILTIN("property",          &PyProperty_Type);