Title: Typing for metaclass examples · Issue #42 · fluentpython/example-code-2e · GitHub
Open Graph Title: Typing for metaclass examples · Issue #42 · fluentpython/example-code-2e
X Title: Typing for metaclass examples · Issue #42 · fluentpython/example-code-2e
Description: Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy) Dog = record_factory('Dog', 'name weight owner') rex = Dog('Rex', 30, 'Bob') We do not get static type checking on, e.g., rex.name ...
Open Graph Description: Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy) Dog = record_factory('Dog', 'name weight owner') rex = Dog('Rex', 30, 'Bob') We do not get ...
X Description: Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy) Dog = record_factory('Dog', 'name weight owner') rex = Dog('Rex', 3...
Opengraph URL: https://github.com/fluentpython/example-code-2e/issues/42
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Typing for metaclass examples","articleBody":"Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy)\r\n\r\n```\r\nDog = record_factory('Dog', 'name weight owner') \r\nrex = Dog('Rex', 30, 'Bob')\r\n```\r\nWe do not get static type checking on, e.g., `rex.name`\r\n\r\nIs there an easy fix, or is this because types in metaclasses / metaprogramming are hard? ","author":{"url":"https://github.com/jsrozner","@type":"Person","name":"jsrozner"},"datePublished":"2024-04-05T22:16:18.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/42/example-code-2e/issues/42"}
| 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:ec4bdef2-52dc-afe4-6f54-1e00eeb6fd38 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D8E0:2ACEE1:1453974:1B84698:69700CF8 |
| html-safe-nonce | 6c6604227b67fd0d8a53bbc79b7ae7084c9940b261d866ec850d224d1965dc84 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOEUwOjJBQ0VFMToxNDUzOTc0OjFCODQ2OTg6Njk3MDBDRjgiLCJ2aXNpdG9yX2lkIjoiODc5NTM0MTcwOTY0MjgyOTA0OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 15dff945849d484851118b938982c79725031c65aaecba3dcc11fe61bcd0917f |
| hovercard-subject-tag | issue:2228880242 |
| 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/fluentpython/example-code-2e/42/issue_layout |
| twitter:image | https://opengraph.githubassets.com/7361c5a741c00ce4ce61d33647aca7c9f26e6e6db7995ca204c9595b6a3e6e1f/fluentpython/example-code-2e/issues/42 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/7361c5a741c00ce4ce61d33647aca7c9f26e6e6db7995ca204c9595b6a3e6e1f/fluentpython/example-code-2e/issues/42 |
| og:image:alt | Consider the example in 24-class-metaprog/factories.py (corresponds to example 24-2, page 912 in my copy) Dog = record_factory('Dog', 'name weight owner') rex = Dog('Rex', 30, 'Bob') We do not get ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jsrozner |
| hostname | github.com |
| expected-hostname | github.com |
| None | 6e3493a220046ce21668e7217b5ac322bdc4edd2736ee04362e5462968204bd5 |
| turbo-cache-control | no-preview |
| go-import | github.com/fluentpython/example-code-2e git https://github.com/fluentpython/example-code-2e.git |
| octolytics-dimension-user_id | 9216311 |
| octolytics-dimension-user_login | fluentpython |
| octolytics-dimension-repository_id | 176997413 |
| octolytics-dimension-repository_nwo | fluentpython/example-code-2e |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 176997413 |
| octolytics-dimension-repository_network_root_nwo | fluentpython/example-code-2e |
| 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 | 9f627dfc82200bff3d2b49e4fb4b0a99594a9a9a |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width