1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """This module provides references to built-in Python types.
17
18 In Python 2.x these are in the types module. In Python 3. those
19 references have been removed in favor of explicit use of the natural
20 Python type. We need these in contexts where the binding of the type
21 identifier (e.g., C{int}) has changed to the class representing the
22 XML Schema datatype of the same name (viz., C{xsd:int} or
23 L{pyxb.binding.datatypes.int}), so provide a way to get back to the
24 underlying Python type.
25 """
26
27
28
29 import types
30
31 IntType = types.IntType
32 """The type underlying C{int}."""
33
34 LongType = types.LongType
35 """The type underlying C{long} (for Python 2). Same as L{IntType} in Python 3."""
36
37 FloatType = types.FloatType
38 """The type underlying C{float}"""
39
40 StringTypes = types.StringTypes
41 """The type underlying generic text types. This changes from Python 2 (C{basestr}) to Python 3 (C{str})."""
42
43 BooleanType = types.BooleanType
44 """The type underlying C{bool}"""
45
46 ListType = types.ListType
47 """The type underlying C{list}"""
48
49 TextType = types.UnicodeType
50
51 """The type used to represent text in either Python 2 (C{unicode}) or Python 3 (C{str})."""
52
53 DataType = types.StringType
54
55 """The type used to represent data (8-bit) in either Python 2 (C{str}) or Python 3 (C{bytes})."""
56