Title: non-writeable property `name` in IO · Issue #2824 · python/typeshed · GitHub
Open Graph Title: non-writeable property `name` in IO · Issue #2824 · python/typeshed
X Title: non-writeable property `name` in IO · Issue #2824 · python/typeshed
Description: I'm trying to create my own class that has IO capability. The class instances would have names similar to file names, but specified at the moment of instance creation. However when I try setting name field, mypy is protesting. Here's the...
Open Graph Description: I'm trying to create my own class that has IO capability. The class instances would have names similar to file names, but specified at the moment of instance creation. However when I try setting na...
X Description: I'm trying to create my own class that has IO capability. The class instances would have names similar to file names, but specified at the moment of instance creation. However when I try settin...
Opengraph URL: https://github.com/python/typeshed/issues/2824
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"non-writeable property `name` in IO","articleBody":"I'm trying to create my own class that has IO capability.\r\nThe class instances would have names similar to file names, but specified at the moment of instance creation.\r\nHowever when I try setting `name` field, `mypy` is protesting.\r\n\r\nHere's the minimal repro:\r\n```python\r\nfrom typing import AnyStr, IO\r\nclass MyIO(IO[AnyStr]):\r\n def __init__(self, name: str) -> None:\r\n self.name = name\r\n```\r\n\r\n`mypy` output:\r\n```\r\nTest.py: note: In member \"__init__\" of class \"MyIO\":\r\nTest.py:5: error: Property \"name\" defined in \"IO\" is read-only\r\n```","author":{"url":"https://github.com/jolaf","@type":"Person","name":"jolaf"},"datePublished":"2019-03-05T15:54:47Z","url":"https://github.com/python/typeshed/issues/2824"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:c5118b59-adf6-31cb-2376-bf2bb93d5298 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | AA7C:3EE8F1:12D46C2:18B7EDE:6B0007BD |
| html-safe-nonce | 506c7b342e6d246feddee3da35b0c5913bace7558c62eb93154a2c97904bb532 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQTdDOjNFRThGMToxMkQ0NkMyOjE4QjdFREU6NkIwMDA3QkQiLCJ2aXNpdG9yX2lkIjoiMTAwOTU5OTI0MjMwMzQ0MDgyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 485682d453595e9e72c705ef623a20492cef3ad7e800adb4cca653154b1a6249 |
| hovercard-subject-tag | issue:417367165 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/typeshed/2824/issue_layout |
| twitter:image | https://opengraph.githubassets.com/fd70f84759f3dd8c70ff583599a45f9cac209dc53788fcfed6d8bb210c522e61/python/typeshed/issues/2824 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/fd70f84759f3dd8c70ff583599a45f9cac209dc53788fcfed6d8bb210c522e61/python/typeshed/issues/2824 |
| og:image:alt | I'm trying to create my own class that has IO capability. The class instances would have names similar to file names, but specified at the moment of instance creation. However when I try setting na... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jolaf |
| hostname | github.com |
| expected-hostname | github.com |
| None | 0a0d8686a27478df474dd7415776a7a080cde8838b3cd92ea7601187572e5729 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typeshed git https://github.com/python/typeshed.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 31696383 |
| octolytics-dimension-repository_nwo | python/typeshed |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 31696383 |
| octolytics-dimension-repository_network_root_nwo | python/typeshed |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 16a11879678aaf97e2a42c33ee70830aa084fa37 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width