mirror of
https://github.com/python/cpython.git
synced 2025-10-08 16:11:51 +00:00
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:
parent
bfc672b169
commit
b7f136e73e
1 changed files with 2 additions and 1 deletions
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue