开发者

Python : Using abc in Python < 2.6

开发者 https://www.devze.com 2023-02-25 08:15 出处:网络
Do someone know an implementation of abc for older versions of Python (older than 2.6) ? EDIT : I am for example looking for a snippet that would do the same thing as ABCMeta and abstr开发者_如何学JA

Do someone know an implementation of abc for older versions of Python (older than 2.6) ?

EDIT : I am for example looking for a snippet that would do the same thing as ABCMeta and abstr开发者_如何学JAVAactmethod, with same interface, I actually need to make a piece of code backward compatible


The abc module itself happens to be backwards compatible. Just copy abc.py from 2.6 to somewhere on the pythonpath.


There is nothing like that. But metaclasses are a core concept of Python since a long time.

0

精彩评论

暂无评论...
验证码 换一张
取 消