Maintaining an addon in both 2.79 and 2.8x

I have recently come across the following docs about migrating from 2.79 to 2.80:
https://wiki.blender.org/wiki/Process/Addons/Guidelines/UpdatingScripts

But what if you want to make the addon work on both 2.79 and 2.8x? For many things you can make wrapper functions, e.g. define a function Mult that corresponds to the infix operators * (in 2.79) or @ (in 2.8). Not so pretty, but not a big deal either.

But what really seems like a major pain is annotations. It seems to me that you need to duplicate the definition of all classes that define properties, just because they are assigned with = in 2.79 and : in 2.8. Duplicated class definitions, although doable, will be a pain to maintain.

Is there some better way?

1 Like