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
Extend the socket module #1176
Comments
Hi, I would like to contribute to extending the socket module. Are there any remaining methods which are not assigned to anybody? Should I open another issue and specify which method I want, preventing others from doing the same thing? Or which method is the first priority? |
@posutsai you could add a series of checkboxes in this issue, and mention what you implement. There is not a fixed list, but there is a helper script to determine the missing methods, called I think it is good to mention here what you will start on. |
I would recommend trying to implement the methods needed by
|
@palaviv According to the document on the official Python website, I have referred to the implementation of Could you give me some hint to implement the function? Sorry for asking such an elementary question, since I just start to learn rust and try to understand it deeper by solving a real problem. |
Hi @posutsai , Your best option at this point would be to use fn setsockopt(level: PyIntRef, optname: PyObjectRef, value: OptionalArg<PyObjectRef>, optlen: OptionalArg<PyObjectRef>, vm: &VirtualMachine) {
// handle value and optlen combinations here:
if value.is(vm.get_none()) {
if let Present = oplen {
} else {
return Err(vm.new_type_error("optlen must be supplied when value is None"));
}
} else {
if let Present = oplen {
return Err(vm.new_type_error("optlen must not be supplied when value is not None"));
}
}
} We did not yet build function polymorphism macros into rustpython, and rust does not support it, so this is currently the way to go forwards. |
Hello, may I implement |
@rodrigocam Yeah, feel free to take a shot at it! |
What do you think of this implementation? I'm using the algorithm
|
@rodrigocam looks pretty good! Do you wanna make a PR for that? |
@coolreader18 done! #2311 |
Hi, I would like to contribute to this. |
From a quick comparison I see |
Hi there, I want to start contributing with something. Are here any methods which needs to be implemented? |
my previous comment still stands, (also, try running |
if no one has taken gethostbyname_ex, can I take a crack at it? |
Hi, I want to take a shot at something(s) from it, |
yes, exactly |
it seems most of features are done but many properties left |
The
socket
module is still incomplete. Many methods and types are missing. To add methods to this module, edit the filevm/src/stdlib/socket.rs
accordingly.The text was updated successfully, but these errors were encountered: