- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
➜
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2019-10-24 11:08 by jstasiak, last changed 2022-04-11 14:59 by admin. This issue is now closed.
| Pull Requests | |||
|---|---|---|---|
| URL | Status | Linked | Edit |
| PR 16832 | merged | jstasiak, 2019-10-24 11:08 | |
| PR 20372 | merged | miss-islington, 2020-05-25 07:04 | |
| PR 20424 | merged | taleinat, 2020-05-26 12:16 | |
| PR 20426 | merged | taleinat, 2020-05-26 12:20 |
| Messages (10) | ||
|---|---|---|
| msg355325 - (view) | Author: Jakub Stasiak (jstasiak) * | Date: 2019-10-24 11:08 |
Excerpt from the documentation: """This is a straightforward interface to the Unix select() system call. The first three arguments are sequences of ‘waitable objects’: either integers representing file descriptors or objects with a parameterless method named fileno() returning such an integer:""" In reality it accepts for example dictionary key views (that's how I discovered it) due to its internal usage of PySequence_Fast, which (from https://docs.python.org/3/c-api/sequence.html#c.PySequence_Fast): """Return the sequence or iterable o as an object usable by the other PySequence_Fast* family of functions. If the object is not a sequence or iterable, raises TypeError with m as the message text. Returns NULL on failure.""" I made a pull request to document this behavior in select (https://github.com/python/cpython/pull/16832) but it was recommended that I create this issue because the solution may not be obvious here. |
||
| msg366633 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-04-16 21:51 |
It seems that select() does indeed support arbitrary iterables through the use of PySequence_Fast(). The commit where this was introduced, by Brett Cannon from 2003 (62dba4c2775adfb5a5a97ca012a3ab00c4e28597), doesn't seems to have intended this though: "select.select() now accepts a sequence (as defined by PySequence_Fast()) for its first three arguments." However, regardless of whether this is intentional, it appears that this has been this way for a very long time. So it seems to me that we should document this behavior, as suggested here, since any change to this would be an unacceptable backwards-incompatibility. |
||
| msg367281 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-04-25 20:11 |
It seems pretty clear to me that we should simply update the docs as suggested. If nobody chimes in about this within a week, I intend to merge the PR (GH-16832) with the small fixes I've suggested there. |
||
| msg369841 - (view) | Author: Ido Michael (Ido Michael) * | Date: 2020-05-24 22:48 |
Hey Tal, I see this issue is pending and pretty much done, what else there's to fix here? |
||
| msg369852 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-05-25 07:03 |
New changeset 372ee27d4958302dac7ad6a8711f6fd04771b2e6 by Jakub Stasiak in branch 'master': bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832) https://github.com/python/cpython/commit/372ee27d4958302dac7ad6a8711f6fd04771b2e6 |
||
| msg369853 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-05-25 07:04 |
Nothing further is required; I've merged the PR. Thanks! |
||
| msg369977 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-05-26 12:59 |
New changeset 3f215f35bdb9d666f5a692fc60f800da1bb1e4a9 by Tal Einat in branch '3.7': [3.7] bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832) https://github.com/python/cpython/commit/3f215f35bdb9d666f5a692fc60f800da1bb1e4a9 |
||
| msg369978 - (view) | Author: Tal Einat (taleinat) * ![]() |
Date: 2020-05-26 12:59 |
New changeset e3e800f3d28881cc9de38cd9bcbcf8fbdea238a6 by Tal Einat in branch '3.8': [3.8] bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832) https://github.com/python/cpython/commit/e3e800f3d28881cc9de38cd9bcbcf8fbdea238a6 |
||
| msg369980 - (view) | Author: miss-islington (miss-islington) | Date: 2020-05-26 13:38 |
New changeset 500cd89ecce97750a1af32d4097d9945b7296bac by Miss Islington (bot) in branch '3.9': bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832) https://github.com/python/cpython/commit/500cd89ecce97750a1af32d4097d9945b7296bac |
||
| msg369981 - (view) | Author: Jakub Stasiak (jstasiak) * | Date: 2020-05-26 13:42 |
Cheers for backporting this, Tal, you beat me to it! |
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:59:22 | admin | set | github: 82761 |
| 2020-05-26 13:42:13 | jstasiak | set | messages: + msg369981 |
| 2020-05-26 13:38:25 | miss-islington | set | messages: + msg369980 |
| 2020-05-26 12:59:35 | taleinat | set | messages: + msg369978 |
| 2020-05-26 12:59:30 | taleinat | set | messages: + msg369977 |
| 2020-05-26 12:20:15 | taleinat | set | pull_requests: + pull_request19684 |
| 2020-05-26 12:16:01 | taleinat | set | pull_requests: + pull_request19682 |
| 2020-05-25 07:04:58 | taleinat | set | status: open -> closed versions: + Python 3.10 messages: + msg369853 resolution: fixed stage: patch review -> resolved |
| 2020-05-25 07:04:10 | miss-islington | set | keywords:
+ patch nosy: + miss-islington pull_requests: + pull_request19635 stage: patch review |
| 2020-05-25 07:03:55 | taleinat | set | messages: + msg369852 |
| 2020-05-24 22:48:57 | Ido Michael | set | nosy:
+ Ido Michael messages: + msg369841 |
| 2020-04-25 20:11:25 | taleinat | set | messages: + msg367281 |
| 2020-04-16 21:51:17 | taleinat | set | nosy:
+ taleinat, docs@python messages: + msg366633 assignee: docs@python components: + Documentation |
| 2020-01-25 13:38:12 | cheryl.sabella | set | versions: - Python 3.5, Python 3.6 |
| 2019-10-25 20:26:21 | brandtbucher | set | nosy:
+ brandtbucher |
| 2019-10-24 11:12:06 | corona10 | set | nosy:
+ vstinner, serhiy.storchaka |
| 2019-10-24 11:08:46 | jstasiak | create |
Powered by Roundup Copyright © 1990-2022, Python Software Foundation
Legal Statements

