Skip to content

Some non-Python Java primitives not converted #7

Closed

Description

@iuliux

Some of the primitive types in Java that don't have a correspondent type in Python are not translated correctly.

For example, short in Java should become int in Python. char should become str, and I see that there is a rule in this direction in the config/default.py but no effect.

Test example:

class Primitives {
    char chr;
    byte byt;
    short shr;
    int in_t;
    long lng;
    float flt;
    double dbl;
}

Generates the output:

class Primitives(object):
    chr = char()  # <- Problem
    byt = byte()  # <- Problem
    shr = short()  # <- Problem
    in_t = int()
    lng = long()  # <- Problem
    flt = float()
    dbl = float()

This is a blocker for Issue #6 I started solving.

Activity

  1. natural commented on Apr 23, 2012

    @natural
    Owner

    Fixed in 764be76.

  2. natural commented on Apr 23, 2012

    @natural
    Owner

    Also, I'm not going to change the long() conversion because that's valid Python 2.x. If/when we support 3.x, that will have to go.

  3. iuliux commented on Apr 23, 2012

    @iuliux
    ContributorAuthor

    Thanks for the quick fixing.

    Yes, you're right with long, my bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions