-
-
Notifications
You must be signed in to change notification settings - Fork 30.9k
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
os.sendfile() has improperly named parameter #82559
Comments
os.sendfile() has a keyword-or-positional parameter named "in". Since it is a keyword in Python, it is not possible to pass it as a keyword argument. You can only pass it as a positional argument or using a var-keyword argument (unlikely anybody uses the latter). The preceding parameter, "out", also can not be passed by keyword because of this. It is weird, but usually does not cause a problem. You cannot use a keyword argument, period. But it prevents os.sendfile() from converting to Argument Clinic, because Argument Clinic does not allow using Python keywords as parameter names (I already created a patch for conversion, but in needs to solve this issue first). There are two ways to solve this issue.
|
See also bpo-15078. |
I’m for renaming both. Since the function is about transmitting or copying (on Linux) files src_fd and dst_fd could also be good candidates. |
I would prefer "2. Make "out" and "in" positional-only parameters". It would be a minor incompatible change, but it would make os.sendfile() more consistent with other functions like os.write() which only has positional-only parameters. |
Well, since os.sendfile(in=fd) raises a syntax error, I don't think that it's really a backward incompatible change in practice. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: