[Twisted-Python] Helping the Python 3 port

Glyph glyph at twistedmatrix.com
Wed May 8 20:40:56 EDT 2013


On May 8, 2013, at 4:03 PM, Jonathan Ballet <jon at multani.info> wrote:

> On Wed, May 08, 2013 at 09:36:14AM -0600, Tom Prince wrote:
>> Have you seen https://twistedmatrix.com/trac/wiki/Plan/Python3 ?
>> 
>> That is the plan for porting to python3.
> 
> What about "importing" code from other librairies?
> 
> I have this specific case where I need to support metaclass for both
> Python 2.x and Python 3.x which have different syntax (__metaclass__ and
> class XXX(.., metaclass=...)), which `six` addresses with a function
> called `with_metaclass()` [1]

Within Twisted?  Which case is that?

> Twisted is not depending on this kind of library, how those things
> should be deal with then? I can include this specific snippet (which is
> actually a two-liner)in t.python.compat but what about the license?

Most of the logic in six is pretty trivial, and we already have our own Python-version-compatibility code (in twisted.python.compat) so thus far we have gone with just replicating whatever functionality we need.

Of course, the best is not needing the compatibility code at all, which is why I'm curious exactly which case you're referring to :).

-glyph


More information about the Twisted-Python mailing list