Skip to content

Commit 093c598

Browse files
committed
minimal support for sys.hash_info
1 parent aacb232 commit 093c598

File tree

1 file changed

+21
-0
lines changed
  • graalpython/lib-graalpython

1 file changed

+21
-0
lines changed

graalpython/lib-graalpython/sys.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ def make_flags_class():
7373
flags = make_flags_class()(flags)
7474
del make_flags_class
7575

76+
7677
def make_float_info_class():
7778
from _descriptor import make_named_tuple_class
7879
return make_named_tuple_class(
@@ -93,6 +94,26 @@ def make_float_info_class():
9394
del make_float_info_class
9495

9596

97+
def make_hash_info_class():
98+
from _descriptor import make_named_tuple_class
99+
return make_named_tuple_class(
100+
"hash_info",
101+
["algorithm",
102+
"cutoff",
103+
"hash_bits",
104+
"imag",
105+
"inf",
106+
"modulus",
107+
"nan",
108+
"seed_bits",
109+
"width"]
110+
)
111+
hash_info = make_hash_info_class()(
112+
("java", 0, 64, 0, float('inf').__hash__(), 7, float('nan').__hash__(), 0, 64)
113+
)
114+
del make_hash_info_class
115+
116+
96117
meta_path = []
97118
path_hooks = []
98119
path_importer_cache = {}

0 commit comments

Comments
 (0)