René's URL Explorer Experiment


Title: Support `Any` as an alias for `object` to describe a default typeclass implementation · Issue #307 · dry-python/classes · GitHub

Open Graph Title: Support `Any` as an alias for `object` to describe a default typeclass implementation · Issue #307 · dry-python/classes

X Title: Support `Any` as an alias for `object` to describe a default typeclass implementation · Issue #307 · dry-python/classes

Description: Context. In order to define a default implementation (the one used if no other implementation matches), we currently have to write something like this: from classes import typeclass @typeclass def render(data_value) -> str: """Render a d...

Open Graph Description: Context. In order to define a default implementation (the one used if no other implementation matches), we currently have to write something like this: from classes import typeclass @typeclass def ...

X Description: Context. In order to define a default implementation (the one used if no other implementation matches), we currently have to write something like this: from classes import typeclass @typeclass def ...

Opengraph URL: https://github.com/dry-python/classes/issues/307

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Support `Any` as an alias for `object` to describe a default typeclass implementation","articleBody":"**Context.** In order to define a default implementation (the one used if no other implementation matches), we currently have to write something like this:\r\n\r\n```python\r\nfrom classes import typeclass\r\n\r\n@typeclass\r\ndef render(data_value) -\u003e str:\r\n    \"\"\"Render a data value nicely.\"\"\"\r\n\r\n@render.instance(int)\r\ndef _render_int(data_value: int) -\u003e str:\r\n    return f'This is an integer: {data_value}'\r\n\r\n\r\n@render.instance(object)\r\ndef _render_int(data_value: object) -\u003e str:\r\n    return f'No idea what this is: {data_value}'\r\n\r\n\r\nassert render('BADOOM') == 'No idea what this is: BADOOM'\r\n```\r\n*(this script should be runnable as-is.)*\r\n\r\n**Decision.** Support `Any` as a special case to replace `object`:\r\n\r\n```python\r\n@render.instance(Any)\r\ndef _render_int(data_value: Any) -\u003e str:    # type: ignore\r\n    return f'No idea what this is: {data_value}'\r\n```\r\n\r\n**Consequences.**\r\n* Pro: The code will look a little bit more straightforward;\r\n* Contra: `mypy` with common settings might be unhappy about `Any` being used, but that can be silenced with `type: ignore` I suppose.","author":{"url":"https://github.com/anatoly-scherbakov","@type":"Person","name":"anatoly-scherbakov"},"datePublished":"2021-09-13T13:03:39.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/307/classes/issues/307"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:d04ca268-2a39-8968-9d96-17927086ffcd
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC3E8:A74F2:87E747:B58C39:69697A27
html-safe-nonceb5bf846500d6937c30fbea10fbaf930564c6fee4f2d949ef40098609fe82c20a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDM0U4OkE3NEYyOjg3RTc0NzpCNThDMzk6Njk2OTdBMjciLCJ2aXNpdG9yX2lkIjoiMjM4MDcxODA4MjA5MTQ4MTYzOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacd0e96245620334a83b2784706be99959be814d3831041c148878ae10ce5161ab
hovercard-subject-tagissue:994865351
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/dry-python/classes/307/issue_layout
twitter:imagehttps://opengraph.githubassets.com/88f37d262a8496371a6c3b659073837c9dbaa02434b6f166dc80585cf268b7f2/dry-python/classes/issues/307
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/88f37d262a8496371a6c3b659073837c9dbaa02434b6f166dc80585cf268b7f2/dry-python/classes/issues/307
og:image:altContext. In order to define a default implementation (the one used if no other implementation matches), we currently have to write something like this: from classes import typeclass @typeclass def ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameanatoly-scherbakov
hostnamegithub.com
expected-hostnamegithub.com
Nonec6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881
turbo-cache-controlno-preview
go-importgithub.com/dry-python/classes git https://github.com/dry-python/classes.git
octolytics-dimension-user_id37993755
octolytics-dimension-user_logindry-python
octolytics-dimension-repository_id217621930
octolytics-dimension-repository_nwodry-python/classes
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id217621930
octolytics-dimension-repository_network_root_nwodry-python/classes
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
release212e3e3d3298bf5b313830edfd2399e869f7ea76
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/dry-python/classes/issues/307#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdry-python%2Fclasses%2Fissues%2F307
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fdry-python%2Fclasses%2Fissues%2F307
Sign up https://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=dry-python%2Fclasses
Reloadhttps://github.com/dry-python/classes/issues/307
Reloadhttps://github.com/dry-python/classes/issues/307
Reloadhttps://github.com/dry-python/classes/issues/307
dry-python https://github.com/dry-python
classeshttps://github.com/dry-python/classes
Please reload this pagehttps://github.com/dry-python/classes/issues/307
Notifications https://github.com/login?return_to=%2Fdry-python%2Fclasses
Fork 30 https://github.com/login?return_to=%2Fdry-python%2Fclasses
Star 723 https://github.com/login?return_to=%2Fdry-python%2Fclasses
Code https://github.com/dry-python/classes
Issues 21 https://github.com/dry-python/classes/issues
Pull requests 16 https://github.com/dry-python/classes/pulls
Actions https://github.com/dry-python/classes/actions
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/dry-python/classes/security
Please reload this pagehttps://github.com/dry-python/classes/issues/307
Insights https://github.com/dry-python/classes/pulse
Code https://github.com/dry-python/classes
Issues https://github.com/dry-python/classes/issues
Pull requests https://github.com/dry-python/classes/pulls
Actions https://github.com/dry-python/classes/actions
Security https://github.com/dry-python/classes/security
Insights https://github.com/dry-python/classes/pulse
New issuehttps://github.com/login?return_to=https://github.com/dry-python/classes/issues/307
New issuehttps://github.com/login?return_to=https://github.com/dry-python/classes/issues/307
Support Any as an alias for object to describe a default typeclass implementationhttps://github.com/dry-python/classes/issues/307#top
https://github.com/anatoly-scherbakov
https://github.com/anatoly-scherbakov
anatoly-scherbakovhttps://github.com/anatoly-scherbakov
on Sep 13, 2021https://github.com/dry-python/classes/issues/307#issue-994865351
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

Viewport: width=device-width


URLs of crawlers that visited me.