From b7f136e73eda63c4bef46d2a749faf3692cddc5c Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Wed, 22 Aug 2007 18:14:10 +0000 Subject: 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. --- Lib/io.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Lib/io.py b/Lib/io.py index 40ea687..40c2186 100644 --- 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. -- cgit v0.12