New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add bz2 from CPython 3.10.5 #2444
Conversation
This comment has been minimized.
This comment has been minimized.
7685368
to
0ea2868
Compare
vm/src/stdlib/bz2.rs
Outdated
| BZ2Compressor::make_class(ctx); | ||
|
|
||
| py_module!(vm, "_bz2", { | ||
| "BZ2Decompressor" => named_function!(ctx, _bz2, BZ2Decompressor), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is a WIP, but just a note - it looks like CPython exports _bz2.BZ2[De]compressor as the classes, rather as separate functions. You can move the functionality from _bz2_BZ2Decompressor to an associated function BZ2Decompressor::tp_new, with a #[pyslot] attribute on it, and same with BZ2Compressor. Then you can export directly as "BZ2Decompressor" => BZ2Decompressor::make_class(ctx)
9f28790
to
13a0b61
Compare
7a6843d
to
a625167
Compare
Co-Authored-By: Jeong YunWon <jeong@youknowone.org>
stdlib/src/lib.rs
Outdated
| @@ -25,6 +25,8 @@ mod random; | |||
| mod statistics; | |||
| // TODO: maybe make this an extension module, if we ever get those | |||
| // mod re; | |||
| #[cfg(not(any(target_arch = "wasm32")))] | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #[cfg(not(any(target_arch = "wasm32")))] | |
| #[cfg(not(target_arch = "wasm32"))] |
pretty much copy and pasted from
csv.rs.