Python 3.13.9 (tags/v3.13.9:8183fa5, Oct 14 2025, 14:09:13) [MSC v.1944 64 bit (AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.2.1
>>> xs = 'ahoj'
>>> xb = b'ahoj'
>>> xs
0: 'ahoj'
>>> xb
1: b'ahoj'
>>> type(xs)
2: <class 'str'>
>>> type(xb)
3: <class 'bytes'>
>>> xs_dir_set = set(dir(xs))
>>> xb_dir_set = set(dir(xb))
>>> xs_dir_set - xb_dir_set
4: {'casefold',
'encode',
'format',
'format_map',
'isdecimal',
'isidentifier',
'isnumeric',
'isprintable'}
>>> xb_dir_set - xs_dir_set
5: {'fromhex', 'hex', 'decode', '__bytes__', '__buffer__'}
>>> for x in xs:
... print(xs)
ahoj
ahoj
ahoj
ahoj
>>> for x in xs:
... print(x)
a
h
o
j
>>> for x in xb:
... print(x)
97
104
111
106
>>> xs
6: 'ahoj'
>>> xb
7: b'ahoj'
>>> len(xb_dir_set)
8: 78
>>> len(xs_dir_set)
9: 81
>>> int('61', 16)
10: 97
>>> chr(97)
11: 'a'
>>> xs[0]
12: 'a'
>>> xb[0]
13: 97
>>> xs[0:2]
14: 'ah'
>>> xb[0:2]
15: b'ah'
>>> type(xb[0])
16: <class 'int'>
>>> type(xb[0:2])
17: <class 'bytes'>
>>> xs[0] = 'A'
Traceback (most recent call last):
File "<pyshell#25>", line 1, in <module>
xs[0] = 'A'
~~^^^
TypeError: 'str' object does not support item assignment
>>> xb[0] = b'A'
Traceback (most recent call last):
File "<pyshell#26>", line 1, in <module>
xb[0] = b'A'
~~^^^
TypeError: 'bytes' object does not support item assignment
>>> xs_list = list(xs)
>>> xs_list
18: ['a', 'h', 'o', 'j']
>>> type(xs_list)
19: <class 'list'>
>>> xs_list[0]
20: 'a'
>>> xs_list[0] = 'A'
>>> xs_list
21: ['A', 'h', 'o', 'j']
>>> xb_list = bytearray(xb)
>>> xb_list
22: bytearray(b'ahoj')
>>> xb_list[0]
23: 97
>>> xb_list[0] = b'A'
Traceback (most recent call last):
File "<pyshell#36>", line 1, in <module>
xb_list[0] = b'A'
~~~~~~~^^^
TypeError: 'bytes' object cannot be interpreted as an integer
>>> ord('A')
24: 65
>>> xb_list[0] = 65
>>> xb_list
25: bytearray(b'Ahoj')
>>> xs_list_dir_set = set(dir(xs_list))
>>> len(xs_list_dir_set)
26: 48
>>> xb_list_dir_set = set(dir(xb_list))
>>> len(xb_list_dir_set)
27: 90
>>> xs_list_dir_set - xb_list_dir_set
28: {'__class_getitem__', 'sort', '__reversed__'}
>>> xb_list_dir_set - xs_list_dir_set
29: {'__alloc__',
'__buffer__',
'__mod__',
'__release_buffer__',
'__rmod__',
'capitalize',
'center',
'decode',
'endswith',
'expandtabs',
'find',
'fromhex',
'hex',
'isalnum',
'isalpha',
'isascii',
'isdigit',
'islower',
'isspace',
'istitle',
'isupper',
'join',
'ljust',
'lower',
'lstrip',
'maketrans',
'partition',
'removeprefix',
'removesuffix',
'replace',
'rfind',
'rindex',
'rjust',
'rpartition',
'rsplit',
'rstrip',
'split',
'splitlines',
'startswith',
'strip',
'swapcase',
'title',
'translate',
'upper',
'zfill'}
>>> b''
30: b''
>>> ''
31: ''
>>> str()
32: ''
>>> bytes()
33: b''
>>> list()
34: []
>>> bytearray()
35: bytearray(b'')
>>> bytes(7)
36: b'\x00\x00\x00\x00\x00\x00\x00'
>>> bytearray(7)
37: bytearray(b'\x00\x00\x00\x00\x00\x00\x00')
>>> bytes([7])
38: b'\x07'
>>> bytes({7})
39: b'\x07'
>>> bytes((7,))
40: b'\x07'
>>> bytes((7))
41: b'\x00\x00\x00\x00\x00\x00\x00'
>>> ()
42: ()
>>> type( () )
43: <class 'tuple'>
>>>
>>> type( (7,) )
44: <class 'tuple'>
>>> xb
45: b'ahoj'
>>> xb * 2
46: b'ahojahoj'
>>> 2 * xb
47: b'ahojahoj'
>>> b'%choj' % b'A'
48: b'Ahoj'
>>> '{}hoj'.format('A')
49: 'Ahoj'
>>> x = 'A'
>>> f'{x}hoj'
50: 'Ahoj'
>>> bytearray([0, 1, 2, 3, 2, 1, 0])
51: bytearray(b'\x00\x01\x02\x03\x02\x01\x00')
>>> bytearray([0, 64, 255])
52: bytearray(b'\x00@\xff')
>>> bytearray([0, 65, 255])
53: bytearray(b'\x00A\xff')
>>> bytes([0, 65, 255])
54: b'\x00A\xff'
>>> hex(100)
55: '0x64'
>>>