{"id":24571,"library":"selectors2","title":"selectors2","description":"Back-ported, durable, and portable selectors module for Python. Current version 2.0.2. Maintained but stable; rarely updated.","status":"maintenance","version":"2.0.2","language":"python","source_language":"en","source_url":"https://github.com/sethmlarson/selectors2","tags":["selectors","backport","i/o","multiplexing"],"install":[{"cmd":"pip install selectors2","lang":"bash","label":"Install via pip"}],"dependencies":[],"imports":[{"wrong":"from selectors2 import DefaultSelector","symbol":"DefaultSelector","correct":"from selectors2 import DefaultSelector"}],"quickstart":{"code":"import selectors2\nimport socket\n\nsel = selectors2.DefaultSelector()\nsock = socket.socket()\nsock.bind(('localhost', 1234))\nsock.listen()\nsel.register(sock, selectors2.EVENT_READ)\nwhile True:\n    events = sel.select(timeout=1)\n    for key, mask in events:\n        conn, addr = key.fileobj.accept()\n        print(f'Connection from {addr}')","lang":"python","description":"Create a DefaultSelector and register a listening socket for read events."},"warnings":[{"fix":"Test thoroughly on target platform; consider using stdlib if Python >=3.4 and no exotic platform needed.","message":"selectors2 is not a drop-in replacement for the stdlib selectors module. It may behave differently on exotic platforms.","severity":"gotcha","affected_versions":"all"},{"fix":"Migrate to Python 3.","message":"Python 2 long integers are supported but Python 2 itself is EOL. Upcoming versions may drop Python 2 support.","severity":"deprecated","affected_versions":"2.0.2"}],"env_vars":null,"search_vec":"'2.0.2':14 'back':3 'back-port':2 'backport':21 'current':12 'durabl':5 'i/o':22 'maintain':15 'modul':9 'multiplex':23 'port':4 'portabl':7 'python':11 'rare':18 'selector':8,20 'selectors2':1 'stabl':17 'updat':19 'version':13","created_at":"2026-05-01T08:13:47.317501+00:00","updated_at":"2026-05-01T08:13:47.317501+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\n  File \"/tmp/tmp2owxwn6j/venv/lib/python3.12/site-packages/selectors2.py\", line 25, in <module>\n    from collections import namedtuple, Mapping\nImportError: cannot import name 'Mapping' from 'collections' (/home/xor/anaconda3/"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2.0.2","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":"https://pypi.org/project/selectors2/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}