Title: Inheriting from instantiated generic class causes mocking to fail · Issue #250 · python/typing · GitHub
Open Graph Title: Inheriting from instantiated generic class causes mocking to fail · Issue #250 · python/typing
X Title: Inheriting from instantiated generic class causes mocking to fail · Issue #250 · python/typing
Description: My reproduction (python 2) import mock from typing import Generic, TypeVar T = TypeVar('T') class Bar(Generic[T]): def __init__(self): pass def do_bar(self): print("bar") class Foo(Bar[int]): def do_foo(self): self.do_bar() @mock.patch.o...
Open Graph Description: My reproduction (python 2) import mock from typing import Generic, TypeVar T = TypeVar('T') class Bar(Generic[T]): def __init__(self): pass def do_bar(self): print("bar") class Foo(Bar[int]): def d...
X Description: My reproduction (python 2) import mock from typing import Generic, TypeVar T = TypeVar('T') class Bar(Generic[T]): def __init__(self): pass def do_bar(self): print("bar") class Fo...
Opengraph URL: https://github.com/python/typing/issues/250
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Inheriting from instantiated generic class causes mocking to fail","articleBody":"My reproduction (python 2)\n\n```\nimport mock\n\nfrom typing import Generic, TypeVar\n\nT = TypeVar('T')\n\nclass Bar(Generic[T]):\n def __init__(self):\n pass\n\n def do_bar(self):\n print(\"bar\")\n\nclass Foo(Bar[int]):\n def do_foo(self):\n self.do_bar()\n\n@mock.patch.object(Bar, 'do_bar')\ndef mocked(mock_do_bar):\n mock_do_bar.return_value = None\n foo = Foo()\n foo.do_foo()\n\nmocked()\n```\n\nwill unexpectedly print `bar`.\n\nThe inheritance here is crucial.\n","author":{"url":"https://github.com/jhance","@type":"Person","name":"jhance"},"datePublished":"2016-07-20T16:55:39Z","url":"https://github.com/python/typing/issues/250"}
| 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:11dcd8dd-6b7d-7c34-e68f-97af2c2fc72f |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D83A:1F3799:2BC1D6C:39957C3:6B0016D3 |
| html-safe-nonce | 046746015f247163ddda77ad7e1cfb3b6ffc45b4b0d6aae373352e717cdeaee5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEODNBOjFGMzc5OToyQkMxRDZDOjM5OTU3QzM6NkIwMDE2RDMiLCJ2aXNpdG9yX2lkIjoiNTMxMDcxNTgwNjE4OTg4NTEzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 4dfd07d2edce4e8ea73c2b67e82122124413f1f89edaf24d0e369f46700373cb |
| hovercard-subject-tag | issue:166630468 |
| 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/typing/250/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1fdf2da7c056b3011a6ad3a349e080aecc6ff90078944740b51d10d0bd13ae4a/python/typing/issues/250 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1fdf2da7c056b3011a6ad3a349e080aecc6ff90078944740b51d10d0bd13ae4a/python/typing/issues/250 |
| og:image:alt | My reproduction (python 2) import mock from typing import Generic, TypeVar T = TypeVar('T') class Bar(Generic[T]): def __init__(self): pass def do_bar(self): print("bar") class Foo(Bar[int]): def d... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jhance |
| hostname | github.com |
| expected-hostname | github.com |
| None | a2dd2291b1b13cc9c06f27ec92fa3dbaf34116fc24c9347b8539db61884c59f4 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/typing git https://github.com/python/typing.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 24604008 |
| octolytics-dimension-repository_nwo | python/typing |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 24604008 |
| octolytics-dimension-repository_network_root_nwo | python/typing |
| 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 | 70121d4e855ee0bb7b75cf15d061d91f8863c0f8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width