javaclass

Changeset

37:5dc683099d88
2004-11-12 Paul Boddie raw files shortlog changelog graph Added a mapping of type labels to Python types.
classfile.py (file)
     1.1 --- a/classfile.py	Fri Nov 12 01:27:34 2004 +0100
     1.2 +++ b/classfile.py	Fri Nov 12 01:28:34 2004 +0100
     1.3 @@ -30,6 +30,19 @@
     1.4  def f8(data):
     1.5      return struct.unpack(">d", data[0:8])[0]
     1.6  
     1.7 +descriptor_base_type_mapping = {
     1.8 +    "B" : "int",
     1.9 +    "C" : "str",
    1.10 +    "D" : "float",
    1.11 +    "F" : "float",
    1.12 +    "I" : "int",
    1.13 +    "J" : "int",
    1.14 +    "L" : "object",
    1.15 +    "S" : "int",
    1.16 +    "Z" : "bool",
    1.17 +    "[" : "list"
    1.18 +    }
    1.19 +
    1.20  # Useful mix-ins.
    1.21  
    1.22  class PythonMethodUtils: