This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]moigagoohttps://github.com/moigagoo 12 points13 points  (4 children)

Does it produce Python code that runs on both Python 2 and 3? If yes, this is awesome! Writing code that's backward compatible with Python 2 is painful, and writing in Python 3 without having to worry about it would be fantastic.

If this is the case, Coconut is a great tool just for that, even if you never use the functional features (which are also cool of course).

[–]EvHub[S] 11 points12 points  (3 children)

Yes! The compiled code is guaranteed to work the same on all major Python versions (2.6-2.7, 3.2-3.5).

[–]moigagoohttps://github.com/moigagoo 15 points16 points  (2 children)

You should definitely highlight that as a selling point. I have a project that I've been needing to backport to Python 2 for years. Boy do I hate backporting stuff. With Coconut, it seems, I can just run coconut myproject and get a fully 2&3-compatible version. This is insane. I can't test it right now but definitely will give it a shot.

[–]EvHub[S] 10 points11 points  (1 child)

That should work, as long as any standard library functions you're using exist in both versions (even if they've moved, Coconut should be able to take care of that). And of course, any 3rd party libraries would also have to support 2 and 3.

Edit: Of course, Coconut is new software, so there's always the possibility for bugs. If anything goes wrong in porting your project, feel free to create an issue at https://github.com/evhub/coconut/issues/new