Daniel Chiquito
bf461cdebc
Use CPython hash algorithm for frozenset
...
The original hash algorithm just XOR'd all the hashes of the elements of
the set, which is problematic. The CPython algorithm is required to pass
the tests.
- Replace `PyFrozenSet::hash` with CPython's algorithm
- Remove unused `hash_iter_unorded` functions
- Add `frozenset` benchmark
- Enable tests
- Lower performance expectations on effectiveness test
- Adjust `slot::hash_wrapper` so that it doesn't rehash the computed
hash value in the process of converting PyInt to PyHash.
2024-02-09 21:02:40 -05:00
kingiler
bdf228eb42
Fix bug in binascii uu encoding. Pass more related unit tests. ( #5160 )
...
* Fix bug in binascii, passes more unit tests.
* Pass more additional tests due to this PR.
2024-02-09 22:42:39 +09:00
Daniel Chiquito
43d7c71a68
Fix integer rounding
...
The [docs](https://docs.python.org/3/library/functions.html#round )
specify that calling `round` with a negative precision removes
significant digits, so that `round(12345, -2) == 12300`. The
implementation was simply returning the original integer.
Additionally, `round(a, b)` is implemented as `(a / 10^b) * 10^b`, using
half-even rounding during the division.
2024-02-07 14:19:17 -05:00
Alin-Ioan Alexandru
3eda1cf3b4
Deprecation warning fix for __complex__ ( #5152 )
2024-01-25 14:54:06 +09:00
deantvv
6917b4c2ca
os: ns_to_sec rounding ( #5150 )
...
In cpython, they use `_PyTime_ROUND_FLOOR` to read time.
But in RustPython, we use `[Duration::from_secs_f64](https://doc.rust-lang.org/std/time/struct.Duration.html#method.try_from_secs_f64 )` to read time.
Therefore, RustPython isn't affected by the rounding issue in the way
that cpython does. We can safely ignore the `0.5*1e-9` bit in
`ns_to_sec` function.
2024-01-23 20:09:22 +09:00
kenny the :/
aaae566231
Raise error on power with negative number ( #5143 )
2024-01-12 21:16:53 +09:00
NakanoMiku
28f0fa48a4
Fix abc error messages ( #5140 )
...
Co-authored-by: Jeong, YunWon <jeong@youknowone.org >
2024-01-11 17:48:56 +09:00
NakanoMiku
de626b8627
Update test_file.py from CPython v3.12.0
2023-12-25 15:19:28 +08:00
NakanoMiku
f519ffdb18
Add asynchat.py and asyncore.py from CPython v3.12.0
2023-12-24 04:11:04 +08:00
NakanoMiku
57f9478d16
Add test_bz2.py from CPython v3.12.0
2023-12-24 04:07:12 +08:00
NakanoMiku
5700fa3953
Update argparse.py from CPython v3.12.0
2023-12-24 04:05:39 +08:00
NakanoMiku
44438bffbd
Update argparse.py from CPython v3.12.0
2023-12-24 04:04:25 +08:00
NakanoMiku
dd0c393b45
Update test_bdb.py from CPython v3.12.0
2023-12-24 04:03:20 +08:00
NakanoMiku
a00a387735
Update bdb.py from CPython v3.12.0
2023-12-24 03:59:38 +08:00
NakanoMiku
b4ee044fa6
Update test_base64.py from CPython v3.12.0
2023-12-24 03:58:36 +08:00
NakanoMiku
df98264dd0
Update base64.py from CPython v3.12.0
2023-12-24 03:58:10 +08:00
NakanoMiku
b6c2179893
Update test_bisect.py from CPython v3.12.0
2023-12-24 03:56:28 +08:00
NakanoMiku
b5176fdbc0
Update bisect.py from CPython v3.12.0
2023-12-24 03:54:18 +08:00
NakanoMiku
79231ee399
Edit test_abc.py
2023-12-22 03:22:28 +08:00
NakanoMiku
c0f6a2f8c3
Update test_abc.py from CPython v3.12.0
2023-12-22 03:18:10 +08:00
NakanoMiku
99531514c8
Update abc.py from CPython v3.12.0
2023-12-22 03:15:47 +08:00
Jeong, YunWon
0fab6e6063
Merge pull request #5127 from NakanoMiku39/main
...
Update test files from CPython v3.12.0
2023-12-01 04:14:02 +09:00
NakanoMiku
784b5f1b1c
Edit test_dictviews
...
ExpectedFailure added at line 282
2023-11-30 21:58:26 +08:00
NakanoMiku
3945e9a4ed
Update test_epoll.py from CPython v3.12.0
2023-11-30 21:06:09 +08:00
NakanoMiku
ad3f0aecaf
Update test_eof.py from CPython v3.12.0
2023-11-30 21:05:18 +08:00
NakanoMiku
1d76b762c7
Update test_eintr.py from CPython v3.12.0
2023-11-30 21:01:17 +08:00
NakanoMiku
f7c7398ba8
Update test_dynamic.py from CPython v3.12.0
2023-11-30 20:55:54 +08:00
NakanoMiku
186eac5095
Update test_dtrace.py from CPython v3.12.0
2023-11-30 20:55:02 +08:00
NakanoMiku
43ede611e3
Update test_dictviews.py from CPython v3.12.0
2023-11-30 20:53:15 +08:00
NakanoMiku
d5e4af7a4b
Update test_dict.py from CPython v3.12.0
2023-11-30 20:51:40 +08:00
NakanoMiku
f1991c25bc
Edit test_descrtut.py
...
ExpectedFailures at line 469-472
I'm not able to put a @unittest.expectedFailure for each tests so I commented them out
2023-11-30 20:48:58 +08:00
NakanoMiku
c4e2d6e379
Add test_descrtut.py from CPython v3.12.0
2023-11-30 20:46:29 +08:00
NakanoMiku
b11d554c11
Edit test_descr.py
...
Skip test at line 1861
ExpectedFailure at line 5104
2023-11-30 20:45:05 +08:00
NakanoMiku
b05d5920ab
Update test_descr.py from CPython v3.12.0
2023-11-30 20:40:19 +08:00
NakanoMiku
926c4cef27
Update test_defaultdict.py from CPython v3.12.0
2023-11-30 20:27:46 +08:00
NakanoMiku
5c6b4cbd3c
Update test_decorators.py from CPython v3.12.0
2023-11-30 20:27:09 +08:00
NakanoMiku
b93199f007
Update test_context.py from CPython v3.12.0
2023-11-30 20:11:24 +08:00
NakanoMiku
07f013dae2
Edit test_complex.py
...
ExpectedFailures added
2023-11-30 20:07:44 +08:00
NakanoMiku
fa3eae677d
Update test_complex.py from CPython v3.12.0
2023-11-30 20:06:24 +08:00
NakanoMiku
c5364ca157
Update test_compare.py from CPython v3.12.0
2023-11-30 20:01:48 +08:00
NakanoMiku
c28cca97d1
Update test_code_module.py from CPython v3.12.0
2023-11-30 19:53:37 +08:00
NakanoMiku
9a61716f74
Edit test_cmd_line_script.py
2023-11-30 19:52:25 +08:00
NakanoMiku
700f2b9c12
Update test_cmd_line_script.py from CPython v3.12.0
2023-11-30 19:49:27 +08:00
NakanoMiku
999dcbdd1b
Edit test_cmd_line.py
2023-11-30 19:48:22 +08:00
NakanoMiku
06bb68a6c6
Update test_cmd_line.py from CPython v3.12.0
2023-11-30 19:45:47 +08:00
ChenyG
dc4f6994fb
Support slice hash ( #5123 )
...
* make slice object hashable
* Update test_slice.py from CPython v3.12
* remove TODO
* remove outdated tests
2023-11-25 13:11:17 +09:00
Jeong, YunWon
8fc2c39d62
Merge pull request #5122 from NakanoMiku39/main
...
Update test files from CPython v3.12.0
2023-11-23 23:10:36 +09:00
ChenyG
4d6a180638
Update ast, test_ast from CPython 3.12.0 ( #5121 )
2023-11-23 23:06:12 +09:00
NakanoMiku
460e9833f0
Edit Lib/test/test_cmath.py
...
ExpectedFailure added at line 628
2023-11-23 16:38:32 +08:00
NakanoMiku
c8256c5450
Update Lib/test/test_cmath.py from CPython v3.12.0
2023-11-23 16:36:59 +08:00