Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue22054

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:Add os.get_blocking() and os.set_blocking() functions
Type:enhancementStage:
Components:Versions:Python 3.5
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: akira, neologix, pitrou, python-dev, vstinner
Priority:normalKeywords:patch

Created on2014-07-23 21:30 byvstinner, last changed2022-04-11 14:58 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
os_blocking.patchvstinner,2014-07-23 21:30review
os_blocking-2.patchvstinner,2014-07-23 21:39review
Messages (9)
msg223782 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-07-23 21:30
Antoine suggested me to add these functions in the issue#22042.Here is a patch to implement these functions and use them in various places.
msg223784 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-07-23 21:39
Oops, test_asyncio was failing. Fixed patched.
msg224131 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-07-27 13:50
Can someone please review my patch?
msg224162 -(view)Author: Akira Li (akira)*Date: 2014-07-28 11:07
Maybe is_something() is a better name than get_something()if something is a boolean?
msg224165 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-07-28 12:39
> Maybe is_something() is a better name than get_something()> if something is a boolean?os and socket modules already use getxxx() / setxxx() names:- os.get_inheritable() / os.set_inheritable()- os.getuid() / os.setuid()- os.getgroups() / os.setgroups()- os.getxattr() os.setxattr()- socket.gettimeout() / socket.settimeout()- socket.get_inheritable() / socket.set_inheritable()- etc.There is only one "is" function: os.isatty(), but it does not have a "os.settty" method.
msg224170 -(view)Author: Akira Li (akira)*Date: 2014-07-28 14:52
> os and socket modules already use getxxx() / setxxx() names:>> - os.get_inheritable() / os.set_inheritable()> - os.getuid() / os.setuid()> - os.getgroups() / os.setgroups()> - os.getxattr() os.setxattr()> - socket.gettimeout() / socket.settimeout()> - socket.get_inheritable() / socket.set_inheritable()> - etc.egid, euid, gid, groups, pgid, pgrp, priority, resgid, sid, uid, xatrr,hostname, timeout, sockopt are not boolean. Thoughget_inheritable() spoils the pot.Compare:  if os.get_blocking(fd): # is it a bug? Does it return some mode bits?     # Do I need stat.IS_BLK(os.get_blocking(fd)) here instead?And:  if os.is_blocking(fd):     # it is clear that fd is blockingThere could be an argument that get_inheritable should be renamed tois_inheritable instead.
msg224171 -(view)Author: Charles-François Natali (neologix)*(Python committer)Date: 2014-07-28 16:54
I agree with Akira, although it's probably too late now to rename.
msg224184 -(view)Author: STINNER Victor (vstinner)*(Python committer)Date: 2014-07-28 20:30
Guido van Rossum told me that he's ok for "get": "I'd go with get, since that seems the tradition in the os module."
msg224247 -(view)Author: Roundup Robot (python-dev)(Python triager)Date: 2014-07-29 20:38
New changeset8f0b8ddbb66b by Victor Stinner in branch 'default':Issue#22054: Add os.get_blocking() and os.set_blocking() functions to get andhttp://hg.python.org/cpython/rev/8f0b8ddbb66b
History
DateUserActionArgs
2022-04-11 14:58:06adminsetgithub: 66253
2014-07-29 20:39:06vstinnersetstatus: open -> closed
resolution: fixed
2014-07-29 20:38:50python-devsetnosy: +python-dev
messages: +msg224247
2014-07-28 20:30:51vstinnersetmessages: +msg224184
2014-07-28 16:54:18neologixsetmessages: +msg224171
2014-07-28 14:52:46akirasetmessages: +msg224170
2014-07-28 12:39:20vstinnersetmessages: +msg224165
2014-07-28 11:07:35akirasetnosy: +akira
messages: +msg224162
2014-07-27 13:50:38vstinnersetmessages: +msg224131
2014-07-23 21:39:07vstinnersetfiles: +os_blocking-2.patch

messages: +msg223784
2014-07-23 21:30:14vstinnercreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp