Make IOBase (and hence all other classes in io.py) use ABCMeta as its metaclass,

so you can use their class .register() method to register virtual subclasses.
This commit is contained in:
Guido van Rossum 2007-08-22 18:14:10 +00:00
parent bfc672b169
commit b7f136e73e

View file

@ -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.