Title: Blamed location is wrong when return type annotation is violated · Issue #15 · skogsbaer/write-your-python-program · GitHub
Open Graph Title: Blamed location is wrong when return type annotation is violated · Issue #15 · skogsbaer/write-your-python-program
X Title: Blamed location is wrong when return type annotation is violated · Issue #15 · skogsbaer/write-your-python-program
Description: Given the following example: def foo(flag: bool) -> int: print('Hello World') if flag: return 1 else: return 'you stupid' foo(False) we get this error: untypy.error.UntypyTypeError given: 'you stupid' expected: value of type int context:...
Open Graph Description: Given the following example: def foo(flag: bool) -> int: print('Hello World') if flag: return 1 else: return 'you stupid' foo(False) we get this error: untypy.error.UntypyTypeError given: 'you stup...
X Description: Given the following example: def foo(flag: bool) -> int: print('Hello World') if flag: return 1 else: return 'you stupid' foo(False) we get this error: untypy.error.UntypyTypeErr...
Opengraph URL: https://github.com/skogsbaer/write-your-python-program/issues/15
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Blamed location is wrong when return type annotation is violated","articleBody":"Given the following example:\r\n\r\n```python\r\ndef foo(flag: bool) -> int:\r\n print('Hello World')\r\n if flag:\r\n return 1\r\n else:\r\n return 'you stupid'\r\n\r\nfoo(False)\r\n```\r\n\r\nwe get this error:\r\n\r\n```\r\nuntypy.error.UntypyTypeError\r\ngiven: 'you stupid'\r\nexpected: value of type int\r\n\r\ncontext: foo(flag: bool) -> int\r\n ^^^\r\ndeclared at: test.py:1\r\n 1 | def foo(flag: bool) -> int:\r\n 2 | print('Hello World')\r\n 3 | if flag:\r\n 4 | return 1\r\n 5 | else: | ...\r\n\r\ncaused by: test.py:1\r\n 1 | def foo(flag: bool) -> int:\r\n 2 | print('Hello World')\r\n 3 | if flag:\r\n 4 | return 1\r\n 5 | else: | ...\r\n```\r\n\r\nI would expect that the line with `return 'you stupid'` is blamed for the error and therefor mentioned in the \"caused by\" part.","author":{"url":"https://github.com/skogsbaer","@type":"Person","name":"skogsbaer"},"datePublished":"2021-09-23T10:43:26Z","url":"https://github.com/skogsbaer/write-your-python-program/issues/15"}
| 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:70d57b7b-b780-051c-ea5b-86c6a5d68265 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8260:37820D:57E12C:77BC6F:6B00C851 |
| html-safe-nonce | b23348c41809860eba467afe048ebab09c17540dc4bbe289c4e488ee2a5f98c8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MjYwOjM3ODIwRDo1N0UxMkM6NzdCQzZGOjZCMDBDODUxIiwidmlzaXRvcl9pZCI6IjIwMTU4ODE1MzExMDg2NzM2MTciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | a2b386a49d8a1d567609c5ce06a099dcc5d434265b221e4f93b6c3ca8ba119f1 |
| hovercard-subject-tag | issue:1005278373 |
| 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/skogsbaer/write-your-python-program/15/issue_layout |
| twitter:image | https://opengraph.githubassets.com/6e5877b8015616ec14ad6e8b6b42dbb06e6dec04c21c753acedff963e0b85c4e/skogsbaer/write-your-python-program/issues/15 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/6e5877b8015616ec14ad6e8b6b42dbb06e6dec04c21c753acedff963e0b85c4e/skogsbaer/write-your-python-program/issues/15 |
| og:image:alt | Given the following example: def foo(flag: bool) -> int: print('Hello World') if flag: return 1 else: return 'you stupid' foo(False) we get this error: untypy.error.UntypyTypeError given: 'you stup... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | skogsbaer |
| hostname | github.com |
| expected-hostname | github.com |
| None | 98dc00e171c204462a6f367482a0f8c3c6b5dbca99cd7390e82d2df49ce096e4 |
| turbo-cache-control | no-preview |
| go-import | github.com/skogsbaer/write-your-python-program git https://github.com/skogsbaer/write-your-python-program.git |
| octolytics-dimension-user_id | 567524 |
| octolytics-dimension-user_login | skogsbaer |
| octolytics-dimension-repository_id | 295649345 |
| octolytics-dimension-repository_nwo | skogsbaer/write-your-python-program |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 295649345 |
| octolytics-dimension-repository_network_root_nwo | skogsbaer/write-your-python-program |
| 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 | ef013399cf0a3c324bea644a685d7c1e0f06b5b7 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width