Registry / serialization / selectors2

selectors2

JSON →
library2.0.2pypypiunverified

Back-ported, durable, and portable selectors module for Python. Current version 2.0.2. Maintained but stable; rarely updated.

pip install selectors2
INSTALL
IMPORT
SIG · SELECTORS2
S
selectors2
serializationpythonv2.0.2
Install
1.5s avg
Import
20ms
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v2.0.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.004s · 17.8MB
glibc
py 3.10–3.95 runs
installs and imports cleanly · install 1.5s · import 0.004s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

DefaultSelector
✓ from selectors2 import DefaultSelector
✗ from selectors2 import DefaultSelector

Create a DefaultSelector and register a listening socket for read events.

import selectors2 import socket sel = selectors2.DefaultSelector() sock = socket.socket() sock.bind(('localhost', 1234)) sock.listen() sel.register(sock, selectors2.EVENT_READ) while True: events = sel.select(timeout=1) for key, mask in events: conn, addr = key.fileobj.accept() print(f'Connection from {addr}')
Debug
Known issues
gotchaselectors2 is not a drop-in replacement for the stdlib selectors module. It may behave differently on exotic platforms.
fix
Test thoroughly on target platform; consider using stdlib if Python >=3.4 and no exotic platform needed.
affects: all
deprecatedPython 2 long integers are supported but Python 2 itself is EOL. Upcoming versions may drop Python 2 support.
fix
Migrate to Python 3.
affects: 2.0.2
Upgrade
Version history
2.0.2latest on PyPI · released Jul 21, 2020
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
Resources
selectors2 — pip install selectors2 · libregistry