0

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 abstractmethod, with same interface, I actually need to make a piece of code backward compatible

sebpiq
  • 6,764
  • 8
  • 44
  • 65

2 Answers2

1

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

A. Coady
  • 44,841
  • 8
  • 28
  • 36
-2

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

Andreas Jung
  • 1
  • 18
  • 70
  • 118
  • "But metaclasses are a core concept of Python since a long time." > what do you mean ? – sebpiq Apr 18 '11 at 08:46
  • I means what i wrote. We have metaclasses in Python since a long time. Google it. – Andreas Jung Apr 18 '11 at 09:25
  • Yes ... I know metaclasses thanks, I use them every day. I need an implementation of virtual classes ! Is there something you didn't understand in my question ??? – sebpiq Apr 18 '11 at 10:26