The basic IronPython type, IronPython type
By presenting the basic types of IronPython, it is easy to understand and remember.
Basic Data Type
|
Data Type |
Type |
Example |
Remarks |
|
Byte string |
Str |
'Hello'
"Hello"
"Hello """
'''Hello ''' |
In IronPython, byte string and unicode string are of the same data type. |
|
Unicode string |
Unicode |
U'hello'
U "hello"
U "hello """ |
|
|
Integer |
Int |
3
-3 |
|
|
Long integer |
Long |
3L |
|
|
Floating point |
Float |
0.0
-3 |
|
|
Complex number |
Complex |
2 + 3j |
|
|
List |
List |
[]
[1, 2, 3]
[1, 'A', 3] |
|
|
Tuple |
Tuple |
()
(2 ,)
(1, 2) |
|
|
Dict |
Dict |
{}
{"Key": 'value '} |
|
|
Set |
Set |
Set ()
Set ([1, 2, 4]) |
|
|
None |
None |
|
It is synonymous with NULL in C #. |
|
Boolean |
Bool |
True
False |
|
Note:
1. Both str and unicode are based on basestring. to check whether the object is of the string type, you can use isinstance (someObject, basestring)
2. The values below are False in IronPython:
False and None
0 (int, long, float)
Empty string (str, unicode)
Empty set, list, tuple, dict