]> granicus.if.org Git - python/commitdiff
Make IOBase (and hence all other classes in io.py) use ABCMeta as its metaclass,
authorGuido van Rossum <guido@python.org>
Wed, 22 Aug 2007 18:14:10 +0000 (18:14 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 22 Aug 2007 18:14:10 +0000 (18:14 +0000)
so you can use their class .register() method to register virtual subclasses.

Lib/io.py

index 40ea6873a6506ff1337e831243b8e6b8a9894684..40c2186f300ddf8c9e80eeb4a7eb6e94588982ec 100644 (file)
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -31,6 +31,7 @@ __all__ = ["BlockingIOError", "open", "IOBase", "RawIOBase", "FileIO",
            "BufferedRandom", "TextIOBase", "TextIOWrapper"]
 
 import os
+import abc
 import sys
 import codecs
 import _fileio
@@ -178,7 +179,7 @@ class UnsupportedOperation(ValueError, IOError):
     pass
 
 
-class IOBase:
+class IOBase(metaclass=abc.ABCMeta):
 
     """Base class for all I/O classes.