You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Andrii Shyshkalov (JIRA)" <ji...@apache.org> on 2013/10/29 09:00:38 UTC

[jira] [Updated] (THRIFT-1697) Generate *explicit* relative imports in Python, rather than implicit ones

     [ https://issues.apache.org/jira/browse/THRIFT-1697?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrii Shyshkalov updated THRIFT-1697:
--------------------------------------

    Attachment: thrift-1697-python-relative-imports.patch

This patch implements relative imports inside individual thrift protocols as well as those which use include others. This way, one import the generated Python modules using absolute or relative imports.

> Generate *explicit* relative imports in Python, rather than implicit ones
> -------------------------------------------------------------------------
>
>                 Key: THRIFT-1697
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1697
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Python - Compiler
>            Reporter: Alex Gaynor
>         Attachments: thrift-1697-python-relative-imports.patch
>
>
> Currently the compiler generates code that looks like:
> import ttypes
> Which relies on the implicit import machinery to load the module in the same directory.
> It would be much better to use
> from . import ttypes



--
This message was sent by Atlassian JIRA
(v6.1#6144)