Guido van Rossum <guido <at> python.org> writes: > > Without a shared ABC you'd defeat the whole point of having ABCs. > > However, importing ABCs (which are defined in Python) from C code > (especially such fundamental C code as the I/O library) is really > subtle and best avoided. > > In io.py I solved this by having a Python class inherit from both the > ABC (RawIOBase) and the implementation (_fileio._FileIO). My plan (let's call it "the Operation") is to define the ABCs in Python by deriving the C concrete base classes (that is, have io.XXXIOBase derive _io.XXXIOBase). This way, by inheriting io.XXXIOBase, user code will benefit both from ABC inheritance and fast C concrete implementations. In turn, the concrete implementations in _pyio (the Python version) would register() those ABCs. The reason I think the Python implementations shouldn't be involved in the default inheritance tree is that we don't want user classes to inherit a __del__ method. All this is assuming I haven't made any logic error. Otherwise, I'll have to launch "the new Operation". Regards Antoine.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4