Skip to content
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

Use @abstractmethod for abstract properties in typing #8726

Closed
wants to merge 1 commit into from

Conversation

@sobolevn
Copy link
Member Author

It does not look too good 🤔

@github-actions
Copy link
Contributor

Diff from mypy_primer, showing the effect of this PR on open source code:

websockets (https://github.com/aaugustin/websockets)
+ src/websockets/frames.py:273: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

pip (https://github.com/pypa/pip)
+ src/pip/_internal/network/session.py:233: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

vision (https://github.com/pytorch/vision)
+ torchvision/datasets/lsun.py:39: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

anyio (https://github.com/agronholm/anyio)
+ src/anyio/_core/_subprocesses.py:57: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

pegen (https://github.com/we-like-parsers/pegen)
+ src/pegen/utils.py:33: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ src/pegen/utils.py:65: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ src/pegen/web.py:53: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]

tornado (https://github.com/tornadoweb/tornado)
+ tornado/test/util_test.py:226: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ tornado/template.py:365: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ tornado/wsgi.py:173: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/simple_httpclient.py:673: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/simple_httpclient.py:675: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/curl_httpclient.py:226: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/curl_httpclient.py:481: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/web.py:3147: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/test/web_test.py:2416: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/test/options_test.py:77: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ tornado/test/options_test.py:102: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ tornado/test/options_test.py:323: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ tornado/test/httpserver_test.py:980: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/test/httpserver_test.py:1007: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/test/httpserver_test.py:1083: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tornado/test/httpclient_test.py:764: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

streamlit (https://github.com/streamlit/streamlit)
+ lib/streamlit/file_util.py: note: In function "get_encoded_file_data":
+ lib/streamlit/file_util.py:55:16: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/file_util.py:57:12: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/pyplot.py: note: In function "marshall":
+ lib/streamlit/elements/pyplot.py:148:13: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/image.py: note: In function "_validate_image_format_string":
+ lib/streamlit/elements/image.py:184:32: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/image.py: note: In function "_PIL_to_bytes":
+ lib/streamlit/elements/image.py:200:11: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/image.py: note: In function "_ensure_image_size_and_format":
+ lib/streamlit/elements/image.py:255:24: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/file_uploader.py: note: In member "deserialize" of class "FileUploaderSerde":
+ lib/streamlit/elements/file_uploader.py:90:22: error: Cannot instantiate abstract class "UploadedFile" with abstract attribute "mode"  [abstract]
+ lib/streamlit/elements/camera_input.py: note: In member "deserialize" of class "CameraInputSerde":
+ lib/streamlit/elements/camera_input.py:117:28: error: Cannot instantiate abstract class "UploadedFile" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/error_util_test.py: note: In member "test_handle_print_rich_exception" of class "ErrorUtilTest":
+ lib/tests/streamlit/error_util_test.py:52:14: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/error_util_test.py: note: In member "test_handle_uncaught_app_exception_with_rich" of class "ErrorUtilTest":
+ lib/tests/streamlit/error_util_test.py:66:18: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/error_util_test.py:78:18: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/elements/video_test.py: note: In member "test_st_video" of class "VideoTest":
+ lib/tests/streamlit/elements/video_test.py:85:18: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/elements/audio_test.py: note: In member "test_st_audio" of class "AudioTest":
+ lib/tests/streamlit/elements/audio_test.py:93:18: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/web/server/component_request_handler_test.py:160:24: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ lib/tests/streamlit/web/server/component_request_handler_test.py:164:24: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]
+ lib/tests/streamlit/web/bootstrap_test.py: note: In member "setUp" of class "BootstrapPrintTest":
+ lib/tests/streamlit/web/bootstrap_test.py:75:22: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]

SinbadCogs (https://github.com/mikeshardmind/SinbadCogs)
+ rolemanagement/massmanager.py:243: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ rolemanagement/massmanager.py:269: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ embedmaker/embedmaker.py:190: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ embedmaker/embedmaker.py:247: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ embedmaker/embedmaker.py:276: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ devtools/runner.py:163: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

check-jsonschema (https://github.com/python-jsonschema/check-jsonschema)
+ src/check_jsonschema/cachedownloader.py:123: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

schemathesis (https://github.com/schemathesis/schemathesis)
+ src/schemathesis/serializers.py: note: In function "_encode_multipart":
+ src/schemathesis/serializers.py:170: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ src/schemathesis/models.py: note: In function "_escape_single_quotes":
+ src/schemathesis/models.py:517: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ src/schemathesis/specs/openapi/loaders.py: note: In function "_format_status_codes":
+ src/schemathesis/specs/openapi/loaders.py:269: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ src/schemathesis/service/report.py: note: In member "add_json_file" of class "ReportWriter":
+ src/schemathesis/service/report.py:37: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ src/schemathesis/service/report.py: note: In function "write_remote":
+ src/schemathesis/service/report.py:163: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

starlette (https://github.com/encode/starlette)
+ starlette/middleware/wsgi.py:30: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/test_datastructures.py:279: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/test_datastructures.py:289: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ starlette/middleware/gzip.py:36: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ starlette/testclient.py:264: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ starlette/testclient.py:341: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

dd-trace-py (https://github.com/DataDog/dd-trace-py)
+ ddtrace/span.py:445: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ ddtrace/profiling/exporter/http.py:175: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ ddtrace/profiling/exporter/http.py:195: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

bokeh (https://github.com/bokeh/bokeh)
+ src/bokeh/sampledata/antibiotics.py:91:24: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ src/bokeh/sampledata/anscombe.py:84:24: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ release/remote.py: note: In function "_upload_file_to_cdn":
+ release/remote.py:34:10: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/bokeh/io/export.py: note: In function "get_screenshot_as_png":
+ src/bokeh/io/export.py:261:24: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

twine (https://github.com/pypa/twine)
+ twine/wheel.py:89: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ twine/commands/check.py:128: error: Cannot instantiate abstract class "_WarningStream" with abstract attribute "mode"

xarray (https://github.com/pydata/xarray)
+ xarray/backends/api.py:1200: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ xarray/tests/test_print_versions.py:9: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ xarray/tests/test_dataset.py:375: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ xarray/tests/test_backends.py:5462: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

jax (https://github.com/google/jax)
+ jax/interpreters/mlir.py:671: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ jax/interpreters/mlir.py:677: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

aioredis (https://github.com/aio-libs/aioredis)
+ aioredis/connection.py:241: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

mongo-python-driver (https://github.com/mongodb/mongo-python-driver)
+ pymongo/message.py: note: In function "_encode_batched_op_msg":
+ pymongo/message.py:1106: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pymongo/message.py: note: In function "_batched_op_msg":
+ pymongo/message.py:1128: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pymongo/message.py: note: In function "_encode_batched_write_command":
+ pymongo/message.py:1170: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ gridfs/grid_file.py: note: In member "__init__" of class "GridIn":
+ gridfs/grid_file.py:196: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ gridfs/grid_file.py: note: In member "__flush_buffer" of class "GridIn":
+ gridfs/grid_file.py:287: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ gridfs/grid_file.py: note: In member "write" of class "GridIn":
+ gridfs/grid_file.py:360: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ gridfs/grid_file.py: note: In member "read" of class "GridOut":
+ gridfs/grid_file.py:561: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ gridfs/grid_file.py: note: In member "readline" of class "GridOut":
+ gridfs/grid_file.py:596: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

pandera (https://github.com/pandera-dev/pandera)
+ pandera/typing/pandas.py:136: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandera/typing/pandas.py:137: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandera/typing/pandas.py:138: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/core/test_errors.py:304: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]

manticore (https://github.com/trailofbits/manticore)
+ manticore/utils/log.py:157: error: Cannot instantiate abstract class "CallbackStream" with abstract attribute "mode"
+ manticore/utils/helpers.py:142: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/core/workspace.py:147: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/core/workspace.py:147: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ manticore/core/workspace.py:161: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/core/workspace.py:161: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ manticore/native/cpu/abstractcpu.py:864: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4130: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4131: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4132: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4133: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4134: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4135: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ manticore/platforms/linux.py:4168: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

isort (https://github.com/pycqa/isort)
+ isort/io.py:30: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ isort/io.py:32: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/io.py:48: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"
+ isort/io.py:73: error: Cannot instantiate abstract class "_EmptyIO" with abstract attribute "mode"
+ isort/core.py:126: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:89: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:90: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:128: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:163: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:164: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:204: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:207: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:262: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:282: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:286: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:355: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"
+ isort/api.py:522: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"

scrapy (https://github.com/scrapy/scrapy)
+ scrapy/extensions/postprocessing.py:58: error: No overload variant of "BZ2File" matches argument types "BinaryIO", "str", "Any"
+ scrapy/extensions/postprocessing.py:58: note: Possible overload variants:
+ scrapy/extensions/postprocessing.py:58: note:     def __init__(self, filename: _WritableFileobj, mode: Literal['w', 'wb', 'x', 'xb', 'a', 'ab'], *, compresslevel: int = ...) -> BZ2File
+ scrapy/extensions/postprocessing.py:58: note:     def __init__(self, filename: _ReadableFileobj, mode: Literal['', 'r', 'rb'] = ..., *, compresslevel: int = ...) -> BZ2File
+ scrapy/extensions/postprocessing.py:58: note:     def __init__(self, filename: Union[str, bytes, PathLike[str], PathLike[bytes]], mode: Union[Literal['', 'r', 'rb'], Literal['w', 'wb', 'x', 'xb', 'a', 'ab']] = ..., *, compresslevel: int = ...) -> BZ2File
+ scrapy/extensions/postprocessing.py:93: error: Cannot instantiate abstract class "LZMAFile" with abstract attributes "mode" and "name"
+ scrapy/core/http2/stream.py:133: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tests/test_spider.py:421: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

black (https://github.com/psf/black)
+ src/blib2to3/pytree.py:844:30: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ src/blib2to3/pgen2/driver.py:211:13: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ src/black/__init__.py:820:17: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]
+ src/black/__init__.py:864:13: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]
+ src/black/__init__.py:1099:14: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/black/__init__.py:1106:10: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]

pandas (https://github.com/pandas-dev/pandas)
+ pandas/core/computation/parsing.py:181: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/core/computation/scope.py:83: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/common.py:369: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/common.py:780: error: Cannot instantiate abstract class "_BytesZipFile" with abstract attribute "mode"  [abstract]
+ pandas/io/common.py:800: error: Cannot instantiate abstract class "_BytesTarFile" with abstract attribute "mode"  [abstract]
+ pandas/io/common.py:805: error: Cannot instantiate abstract class "_BytesTarFile" with abstract attribute "mode"  [abstract]
+ pandas/io/common.py:888: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]
+ pandas/io/orc.py:158: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/xml.py:736: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/xml.py:739: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:753: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:1173: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:2650: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3084: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3267: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3342: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3349: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3356: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3372: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3380: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3396: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/stata.py:3445: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/parquet.py:426: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/clipboards.py:89: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/clipboards.py:132: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/parsers/python_parser.py:221: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/json/_json.py:834: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/formats/format.py:214: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/formats/format.py:284: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/formats/format.py:1166: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/formats/format.py:1227: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/io/excel/_base.py:531: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/io/excel/_base.py:1614: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/core/frame.py:1027: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/core/frame.py:1059: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/core/frame.py:1073: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/compat/pickle_compat.py:290: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/_testing/_io.py:404: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/tests/io/json/test_readlines.py:287: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ pandas/tests/io/test_gcs.py:104: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/tests/io/test_gcs.py:105: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/tests/io/test_gcs.py:110: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ pandas/tests/io/test_gcs.py:111: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

pyppeteer (https://github.com/pyppeteer/pyppeteer)
+ pyppeteer/chromium_downloader.py:86: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

paasta (https://github.com/yelp/paasta)
+ paasta_tools/paasta_metastatus.py:477: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"

core (https://github.com/home-assistant/core)
+ homeassistant/util/aiohttp.py:21: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/auth/mfa_modules/totp.py:43: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/components/stream/recorder.py:88: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/components/stream/worker.py:219: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/components/homekit/util.py:342: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/components/generic/config_flow.py:126: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ homeassistant/components/tts/__init__.py:549: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

werkzeug (https://github.com/pallets/werkzeug)
+ src/werkzeug/wsgi.py:168: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/formparser.py:67: error: Cannot instantiate abstract class "SpooledTemporaryFile" with abstract attributes "closed", "mode" and "name"  [abstract]
+ src/werkzeug/wrappers/request.py:293: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/test.py:67: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/test.py:448: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/test.py:764: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/test.py:766: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ src/werkzeug/debug/__init__.py:410: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/test_send_file.py:45: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/test_send_file.py:68: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ tests/test_formparser.py:380: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ tests/test_datastructures.py:1155: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ tests/test_datastructures.py:1155: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

spark (https://github.com/apache/spark)
+ python/pyspark/pandas/namespace.py:1127: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]

com2ann (https://github.com/ilevkivskyi/com2ann)
+ src/com2ann.py:349: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ src/com2ann.py:778: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"

rich (https://github.com/Textualize/rich)
+ rich/markdown.py:616: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ rich/default_styles.py:179: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ rich/__main__.py:212: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ rich/__main__.py:222: error: Cannot instantiate abstract class "StringIO" with abstract attribute "mode"  [abstract]
+ rich/ansi.py:218: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"  [abstract]
+ rich/progress.py:1262: error: Cannot instantiate abstract class "_Reader" with abstract attribute "mode"  [abstract]
+ rich/progress.py:1359: error: Cannot instantiate abstract class "_Reader" with abstract attribute "mode"  [abstract]
+ rich/progress.py:1363: error: Cannot instantiate abstract class "TextIOWrapper" with abstract attributes "mode" and "name"  [abstract]

optuna (https://github.com/optuna/optuna)
+ tests/visualization_tests/test_slice.py:113: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tests/visualization_tests/test_slice.py:115: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tests/visualization_tests/test_pareto_front.py:312: error: Cannot instantiate abstract class "BytesIO" with abstract attribute "mode"
+ tests/visualization_t

... (truncated 472 lines) ...

@sobolevn
Copy link
Member Author

I've opened a new bug for stubtest: python/mypy#13646

@srittau
Copy link
Collaborator

srittau commented Sep 12, 2022

I mostly consider IO, TextIO and BytesIO a lost cause. There too many nits and incompatibilities to use or type them properly.

@sobolevn
Copy link
Member Author

This is too disruptive. Let's try again later some time :)

@sobolevn sobolevn closed this Sep 12, 2022
AlexWaygood added a commit that referenced this pull request Oct 17, 2022
#8726 proposed to make these properties abstract, but it would have broken half the typed-Python ecosystem, and we've since decided that it's not worth taking action on this (#2146 (comment)). This PR rephrases the comments to make clear that there isn't really anything actionable that can be done here.
srittau pushed a commit that referenced this pull request Oct 17, 2022
#8726 proposed to make these properties abstract, but it would have broken half the typed-Python ecosystem, and we've since decided that it's not worth taking action on this (#2146 (comment)). This PR rephrases the comments to make clear that there isn't really anything actionable that can be done here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants