Commit Graph

13460 Commits

Author SHA1 Message Date
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
Jeong, YunWon
c4b1cc69be Merge pull request #5158 from dchiquito/fix-int-rounding
Fix integer rounding
2024-02-09 13:22:36 +09:00
Daniel Chiquito
36b9219e32 Bump ahash from 0.8.3 to 0.8.7
When building the project for the Miri CI step, the latest nightly
version apparently conflicts with the older `ahash` 0.8.3. Updating to
0.8.7 fixed the build for me locally.
2024-02-07 18:40:28 -05: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
Jeong, YunWon
1983138c91 Merge pull request #5148 from coolreader18/upd-nix
Update nix and socket2
2024-01-10 03:12:13 +09:00
Jeong, YunWon
9cc571be95 Fix windows stdlib build 2024-01-09 20:53:58 +09:00
Noa
602015fca1 Update nix and socket2 2024-01-09 20:53:58 +09:00
Evan Rittenhouse
1ab133dae8 None.__ne__(None) should be NotImplemented (#5124) 2024-01-08 15:03:57 +09:00
Jeong, YunWon
317f449454 Merge pull request #5126 from RustPython/dependabot/cargo/openssl-0.10.60
Bump openssl from 0.10.55 to 0.10.60
2023-12-30 18:04:30 +09:00
Jeong, YunWon
32f662ae80 Bump openssl from 0.10.55 to 0.10.62 2023-12-30 17:14:08 +09:00
Jeong, YunWon
7236109d75 Merge pull request #5144 from youknowone/clippy
Fix 1.75 clippy warnings
2023-12-30 13:16:10 +09:00
Jeong YunWon
506c8a633e Fix redox and nightly 2023-12-30 12:53:57 +09:00
Jeong YunWon
a309cb5d2c Fix 1.75 clippy warnings 2023-12-30 11:48:40 +09:00
Jeong, YunWon
5001b2e572 Merge pull request #5142 from youknowone/windows-sys
Windows sys
2023-12-30 03:48:06 +09:00
Jeong, YunWon
756088e7fb more winapi to windows-sys 2023-12-29 00:40:04 +09:00
Jeong, YunWon
4729ca3af0 Drop winapi from rustpython-vm 2023-12-28 23:44:47 +09:00
Jeong, YunWon
cccfb08835 replace winbase winnt to windows-sys 2023-12-28 22:40:49 +09:00
Jeong, YunWon
d01909a524 replace handleapi to windows-sys 2023-12-28 22:28:49 +09:00
Jeong, YunWon
ee128eac7c replace errorhandling to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon
6df9732965 replace wincon to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon
8a84a479f1 remove processthreadsapi 2023-12-28 22:28:33 +09:00
Jeong, YunWon
7513017e21 replace sysinfoapi to windows-sys 2023-12-28 22:28:33 +09:00
Jeong, YunWon
adf0788895 bump up windows{-sys} 2023-12-28 22:28:33 +09:00
Jeong, YunWon
fc91cd8bc7 clean up winapi features (#5141) 2023-12-28 21:51:26 +09:00
Michał Moskal
459cad8407 update indexmap to 1.9.3 (#5128) 2023-12-28 13:08:08 +09:00
Jeong, YunWon
863a5b5a49 Merge pull request #5134 from NakanoMiku39/main
Update libraries and test files from CPython v3.12
2023-12-28 13:01:13 +09:00
NakanoMiku
1c6336b350 Merge branch 'RustPython:main' into main 2023-12-28 03:26:14 +08:00
Jeong, YunWon
fb12a4c219 Merge pull request #5136 from youknowone/fix-wasi-ci
Fix wasi CI
2023-12-28 02:50:30 +09:00
Jeong YunWon
16a3edd432 Fix wasi CI 2023-12-28 02:34:41 +09:00
Jeong, YunWon
ebc8f60e21 Merge pull request #5135 from youknowone/fix-malachite-version
Fix malachite-bigint version
2023-12-28 02:33:21 +09:00
Jeong YunWon
727f97fd48 Fix malachite-bigint version 2023-12-28 01:50:02 +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