GitHub user davebshow opened a pull request:
https://github.com/apache/tinkerpop/pull/415
Tinkerpop 1448: gremlin-python should be Python 2/3 compatible
https://issues.apache.org/jira/browse/TINKERPOP-1448
This PR adds code to promote Python 2/3 compatibility in the gremlin-python
GLV. The main change here involves adding a module, `compat`, that provides 2/3
compatible type info.
`compat` defines a class `long` for Python 3. `long` inherits from `int`
and behaves like an integer. The advantage of creating this class is it allows
application developers to type an integer as `long` in Python 3 code, which
will result in serialization as `int64` in GraphSON.
`compat` also provides values for standard library `types` module that are
not included in Python 3 (`IntType`, `FloatType`, and `LongType`).
Finally, this PR uses `six.get_function_code` for introspection, as this
API changed with Python 3.
While all tests have been updated accordingly, when building with `mvn
clean install -pl gremlin-python -DglvPython` tests are only run against the
local machine's default version of Python. Therefore, tests are not run on both
versions by default, however, they *will* now pass if a users default Python
interpreter is Python 3.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/apache/tinkerpop TINKERPOP-1448
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/tinkerpop/pull/415.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #415
----
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---