You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tinkerpop.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2016/09/14 16:49:20 UTC
[jira] [Commented] (TINKERPOP-1448) gremlin-python should be Python
2/3 compatible
[ https://issues.apache.org/jira/browse/TINKERPOP-1448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15490904#comment-15490904 ]
ASF GitHub Bot commented on TINKERPOP-1448:
-------------------------------------------
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
----
----
> gremlin-python should be Python 2/3 compatible
> ----------------------------------------------
>
> Key: TINKERPOP-1448
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1448
> Project: TinkerPop
> Issue Type: Improvement
> Components: language-variant
> Affects Versions: 3.2.2
> Reporter: David M. Brown
>
> As discussed here, it is simple to maintain Python 2/3 compatibility for gremlin-python GLV: https://lists.apache.org/thread.html/263739a38133be620dd32640fe997388e76b20379a3dae44b10d4442@%3Cdev.tinkerpop.apache.org%3E
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)