spantaleev / sijax-python

An easy to use AJAX library for Python based on jQuery.ajax

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

target python versions

Midnighter opened this issue · comments

I just tried to install sijax with python 3 and in the current state it does not work. The fix can automatically be done using the 2to3 tool. Now I'm wondering whether you're deliberately supporting some python versions < 2.6 which would make porting your sources a little more involved or if not, your sources could be changed directly.

I'm definitely willing to make the necessary changes and issue a PR.

@Midnighter, maybe #2 is enough to make it work perfectly?

Python 2.5 is supported, because long time ago Flask was encouraging that extensions be compatible with that. There's no need to keep that compatibility anymore, so targeting 2.6+ should be okay.

It's not quite enough. In streaming.py the iterator method .next() needs to be a function in Python 3 and the same is true for a number of the tests. You also import StringTypes which is not available any longer.

The question then is whether you want to have a single source version that supports both Python 2&3 with the help of dependencies like six or future, or have an automatic/manual conversion using 2to3 upon installation with Python 3.

A single code-base is probably better and more predictable than having some automated translation happen upon installation on whatever Python 3.x version the user happens to be running.

In that case, are you ok with adding a dependency like six or future?

Also, Python 2.6+ natively has json support. Would you want to keep the backups like simplejson or just remove them?