René's URL Explorer Experiment


Title: The code `checked_demo.py` in Chapter 24 has TypeError: 'title' type hint must be callable? · Issue #30 · fluentpython/example-code-2e · GitHub

Open Graph Title: The code `checked_demo.py` in Chapter 24 has TypeError: 'title' type hint must be callable? · Issue #30 · fluentpython/example-code-2e

X Title: The code `checked_demo.py` in Chapter 24 has TypeError: 'title' type hint must be callable? · Issue #30 · fluentpython/example-code-2e

Description: Hello, I run the code in https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py #!/usr/bin/env python3 # tag::MOVIE_DEMO[] from checkedlib import Checked class Movie(Checked): titl...

Open Graph Description: Hello, I run the code in https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py #!/usr/bin/env python3 # tag::MOVIE_DEMO[] from checkedlib i...

X Description: Hello, I run the code in https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py #!/usr/bin/env python3 # tag::MOVIE_DEMO[] from checkedlib i...

Opengraph URL: https://github.com/fluentpython/example-code-2e/issues/30

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.114.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The code `checked_demo.py` in Chapter 24 has TypeError: 'title' type hint must be callable?","articleBody":"Hello,\r\n\r\nI run the code in https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py\r\n```\r\n#!/usr/bin/env python3\r\n\r\n# tag::MOVIE_DEMO[]\r\nfrom checkedlib import Checked\r\n\r\nclass Movie(Checked):\r\n    title: str\r\n    year: int\r\n    box_office: float\r\n\r\nif __name__ == '__main__':\r\n    movie = Movie(title='The Godfather', year=1972, box_office=137)\r\n    print(movie)\r\n    print(movie.title)\r\n    # end::MOVIE_DEMO[]\r\n\r\n    try:\r\n        # remove the \"type: ignore\" comment to see Mypy error\r\n        movie.year = 'MCMLXXII'  # type: ignore\r\n    except TypeError as e:\r\n        print(e)\r\n    try:\r\n        blockbuster = Movie(title='Avatar', year=2009, box_office='billions')\r\n    except TypeError as e:\r\n        print(e)\r\n\r\n```\r\nThere is a TypeError:\r\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\nInput In [2], in \u003ccell line: 6>()\r\n      1 #!/usr/bin/env python3\r\n      2 \r\n      3 # tag::MOVIE_DEMO[]\r\n      4 from checkedlib import Checked\r\n----> 6 class Movie(Checked):\r\n      7     title: str\r\n      8     year: int\r\n\r\nFile D:\\books/python/0.   Fluent Python, 2nd Edition/example-code-2e/24-class-metaprog/checked/metaclass\\checkedlib.py:107, in CheckedMeta.__new__(meta_cls, cls_name, bases, cls_dict)\r\n    105 type_hints = cls_dict.get('__annotations__', {})  # \u003c3>\r\n    106 for name, constructor in type_hints.items():   # \u003c4>\r\n--> 107     field = Field(name, constructor)  # \u003c5>\r\n    108     cls_dict[name] = field  # \u003c6>\r\n    109     slots.append(field.storage_name)  # \u003c7>\r\n\r\nFile D:\\books/python/0.   Fluent Python, 2nd Edition/example-code-2e/24-class-metaprog/checked/metaclass\\checkedlib.py:76, in Field.__init__(self, name, constructor)\r\n     74 def __init__(self, name: str, constructor: Callable) -> None:\r\n     75     if not callable(constructor) or constructor is type(None):\r\n---> 76         raise TypeError(f'{name!r} type hint must be callable')\r\n     77     self.name = name\r\n     78     self.storage_name = '_' + name  # \u003c1>\r\n\r\nTypeError: 'title' type hint must be callable\r\n```\r\n\r\nMy python version is Python 3.8.13.\r\n\r\nThanks\r\n\r\n","author":{"url":"https://github.com/danli349","@type":"Person","name":"danli349"},"datePublished":"2022-11-29T14:35:17Z","url":"https://github.com/fluentpython/example-code-2e/issues/30"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:aad0a23d-cd68-123b-5125-15a93e8700cb
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC2F2:26E336:3C9854:51A794:6B06770A
html-safe-nonced8152afa2392518d03a172a2b4db92e1a1f128c1456bae6d6effe3caf49fe70a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMkYyOjI2RTMzNjozQzk4NTQ6NTFBNzk0OjZCMDY3NzBBIiwidmlzaXRvcl9pZCI6IjUwNjY5NzI2OTI3MDA2MjQ2NTAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac47b36678bf8178f0e753ecc42237b75b6540b3aebb91c255780789a1f89d39f4
hovercard-subject-tagissue:1468172748
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/fluentpython/example-code-2e/30/issue_layout
twitter:imagehttps://opengraph.githubassets.com/721700d150f0b584d9d1be4a130b16742ac7a433ae71d1a9169e069559af5d4d/fluentpython/example-code-2e/issues/30
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/721700d150f0b584d9d1be4a130b16742ac7a433ae71d1a9169e069559af5d4d/fluentpython/example-code-2e/issues/30
og:image:altHello, I run the code in https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py #!/usr/bin/env python3 # tag::MOVIE_DEMO[] from checkedlib i...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedanli349
hostnamegithub.com
expected-hostnamegithub.com
None4462ff7ebfd3d551f202659f2423dae617b6849d23b1df6465dc504ef497d14a
turbo-cache-controlno-preview
go-importgithub.com/fluentpython/example-code-2e git https://github.com/fluentpython/example-code-2e.git
octolytics-dimension-user_id9216311
octolytics-dimension-user_loginfluentpython
octolytics-dimension-repository_id176997413
octolytics-dimension-repository_nwofluentpython/example-code-2e
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id176997413
octolytics-dimension-repository_network_root_nwofluentpython/example-code-2e
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release6d3909414814ff86ce7da4c51a0f4918a13fb41b
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/fluentpython/example-code-2e/issues/30#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffluentpython%2Fexample-code-2e%2Fissues%2F30
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Ffluentpython%2Fexample-code-2e%2Fissues%2F30
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=fluentpython%2Fexample-code-2e
Reloadhttps://github.com/fluentpython/example-code-2e/issues/30
Reloadhttps://github.com/fluentpython/example-code-2e/issues/30
Reloadhttps://github.com/fluentpython/example-code-2e/issues/30
fluentpythonhttps://github.com/fluentpython
example-code-2ehttps://github.com/fluentpython/example-code-2e
Codehttps://github.com/fluentpython/example-code-2e
Issues16 (16)https://github.com/fluentpython/example-code-2e/issues
Pull requests12 (12)https://github.com/fluentpython/example-code-2e/pulls
Actionshttps://github.com/fluentpython/example-code-2e/actions
Projectshttps://github.com/fluentpython/example-code-2e/projects
Security and qualityhttps://github.com/fluentpython/example-code-2e/security
Insightshttps://github.com/fluentpython/example-code-2e/insights
https://github.com/fluentpython/example-code-2e
New issuehttps://github.com/login?return_to=https://github.com/fluentpython/example-code-2e/issues/30
New issuehttps://github.com/login?return_to=https://github.com/fluentpython/example-code-2e/issues/30
The code checked_demo.py in Chapter 24 has TypeError: 'title' type hint must be callable?https://github.com/fluentpython/example-code-2e/issues/30#top
https://github.com/danli349
danli349https://github.com/danli349
on Nov 29, 2022https://github.com/fluentpython/example-code-2e/issues/30#issue-1468172748
https://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.pyhttps://github.com/fluentpython/example-code-2e/tree/master/24-class-metaprog/checked/metaclass/checked_demo.py
https://github.com/jackjyq
jackjyqhttps://github.com/jackjyq
on Jun 27, 2023https://github.com/fluentpython/example-code-2e/issues/30#issuecomment-1609652668
https://peps.python.org/pep-0585/#parameters-to-generics-are-available-at-runtimehttps://peps.python.org/pep-0585/#parameters-to-generics-are-available-at-runtime
https://github.com/danli349
danli349https://github.com/danli349
on Jun 27, 2023https://github.com/fluentpython/example-code-2e/issues/30#issuecomment-1609703632
@jackjyqhttps://github.com/jackjyq
Sign up for freehttps://github.com/signup?return_to=https://github.com/fluentpython/example-code-2e/issues/30
Sign in to commenthttps://github.com/login?return_to=https://github.com/fluentpython/example-code-2e/issues/30
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.