René's URL Explorer Experiment


Title: __ceil__, __floor__ and numbers.Real · Issue #3195 · python/typeshed · GitHub

Open Graph Title: __ceil__, __floor__ and numbers.Real · Issue #3195 · python/typeshed

X Title: __ceil__, __floor__ and numbers.Real · Issue #3195 · python/typeshed

Description: PR #3108 (originally) tried to make float a subclass of numbers.Real. Two method implementations were missing, __floor__ and __ceil__ (cpython). These do exist for int and Decimal etc., but @srittau noticed that they actually do not exis...

Open Graph Description: PR #3108 (originally) tried to make float a subclass of numbers.Real. Two method implementations were missing, __floor__ and __ceil__ (cpython). These do exist for int and Decimal etc., but @sritta...

X Description: PR #3108 (originally) tried to make float a subclass of numbers.Real. Two method implementations were missing, __floor__ and __ceil__ (cpython). These do exist for int and Decimal etc., but @sritta...

Opengraph URL: https://github.com/python/typeshed/issues/3195

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"__ceil__, __floor__ and numbers.Real","articleBody":"PR #3108 (originally) tried to make `float` a subclass of `numbers.Real`. Two method implementations were missing, `__floor__` and `__ceil__` ([cpython](https://github.com/python/cpython/blob/29bb227a0ce6d355a2b3e5d6a25872e3702ba9bb/Lib/numbers.py#L178-L186)). These do exist for `int` and `Decimal` etc., but @srittau noticed that they actually do *not* exist for `float` itself, therefore they cannot be added to `float`'s stubs, and `float` cannot be made to conform to `numbers.Real`.\r\n\r\n---\r\n\r\nI did some digging and found that abstractly `numbers.Real` really just wants `math.floor()` and `math.ceil()` to work. And in cpython, these two functions work something like this (using `floor` ):\r\n\r\n1. If the argument is a `float`, do the operation directly in C code.\r\n2. Else, if the argument has a `__floor__` method, use it.\r\n3. Else, if the argument has a `__float__` method, use it and go to (1).\r\n\r\nAs it happen, `numbers.Real` does require `__float__()` to be implemented. So as a workaround for this issue, I proposed removing `__floor__` and `__ceil__` from typeshed's `numbers.Real` stub, since the `__float__` fallback can be relied on instead.\r\n\r\n---\r\n\r\nAnother view is that this is a cpython issue and should be fixed there.\r\n\r\n---\r\n\r\nAnd another view is that `numbers` is a lost cause for static typing and should just be ignored or replaced with something better (like protocols).","author":{"url":"https://github.com/bluetech","@type":"Person","name":"bluetech"},"datePublished":"2019-08-17T09:57:48Z","url":"https://github.com/python/typeshed/issues/3195"}

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:308139e5-42e4-c8db-5bf3-50ce2563a695
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idC218:142FA7:99975:CE6E3:6B001BE9
html-safe-nonce59d7d5fa5f589f369992e741c6307991371c4dc265a54353f348a7c8b66f6722
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDMjE4OjE0MkZBNzo5OTk3NTpDRTZFMzo2QjAwMUJFOSIsInZpc2l0b3JfaWQiOiI5MTE0MTA5NTEyNzI1MzcwNjUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac502a33d148faa2d1320b2c63e89ced4ebd8f627ee7f025b4ae3e47cdbcd6b984
hovercard-subject-tagissue:481870111
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/python/typeshed/3195/issue_layout
twitter:imagehttps://opengraph.githubassets.com/89769b7c0c6d7637c7c07af53ec8b6cd136fae7c6356f23b29b8e1ff2e7b38ae/python/typeshed/issues/3195
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/89769b7c0c6d7637c7c07af53ec8b6cd136fae7c6356f23b29b8e1ff2e7b38ae/python/typeshed/issues/3195
og:image:altPR #3108 (originally) tried to make float a subclass of numbers.Real. Two method implementations were missing, __floor__ and __ceil__ (cpython). These do exist for int and Decimal etc., but @sritta...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamebluetech
hostnamegithub.com
expected-hostnamegithub.com
None4eb4cba0d69f045374ac15de9666d22b0961e1d555cc3824f36b7734c00c78e0
turbo-cache-controlno-preview
go-importgithub.com/python/typeshed git https://github.com/python/typeshed.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id31696383
octolytics-dimension-repository_nwopython/typeshed
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id31696383
octolytics-dimension-repository_network_root_nwopython/typeshed
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
release44c658b24abf00491fb7ae5f56d42c9f38cbeab2
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/typeshed/issues/3195#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Ftypeshed%2Fissues%2F3195
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%2Fpython%2Ftypeshed%2Fissues%2F3195
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=python%2Ftypeshed
Reloadhttps://github.com/python/typeshed/issues/3195
Reloadhttps://github.com/python/typeshed/issues/3195
Reloadhttps://github.com/python/typeshed/issues/3195
pythonhttps://github.com/python
typeshedhttps://github.com/python/typeshed
Codehttps://github.com/python/typeshed
Issues196 (196)https://github.com/python/typeshed/issues
Pull requests251 (251)https://github.com/python/typeshed/pulls
Actionshttps://github.com/python/typeshed/actions
Security and qualityhttps://github.com/python/typeshed/security
Insightshttps://github.com/python/typeshed/insights
https://github.com/python/typeshed
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/3195
New issuehttps://github.com/login?return_to=https://github.com/python/typeshed/issues/3195
#4274https://github.com/python/typeshed/pull/4274
__ceil__, __floor__ and numbers.Realhttps://github.com/python/typeshed/issues/3195#top
#4274https://github.com/python/typeshed/pull/4274
https://github.com/bluetech
bluetechhttps://github.com/bluetech
on Aug 17, 2019https://github.com/python/typeshed/issues/3195#issue-481870111
#3108https://github.com/python/typeshed/pull/3108
cpythonhttps://github.com/python/cpython/blob/29bb227a0ce6d355a2b3e5d6a25872e3702ba9bb/Lib/numbers.py#L178-L186
@srittauhttps://github.com/srittau
https://github.com/srittau
srittauhttps://github.com/srittau
on Oct 11, 2019https://github.com/python/typeshed/issues/3195#issuecomment-540946000
https://github.com/JelleZijlstra
JelleZijlstrahttps://github.com/JelleZijlstra
on Oct 11, 2019https://github.com/python/typeshed/issues/3195#issuecomment-541159073
https://github.com/gvanrossum
gvanrossumhttps://github.com/gvanrossum
on Oct 12, 2019https://github.com/python/typeshed/issues/3195#issuecomment-541339744
https://github.com/bluetech
bluetechhttps://github.com/bluetech
on Oct 29, 2019https://github.com/python/typeshed/issues/3195#issuecomment-547351168
https://bugs.python.org/issue38629https://bugs.python.org/issue38629
https://github.com/staticdev
staticdevhttps://github.com/staticdev
on Jun 26, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650182263
@bluetechhttps://github.com/bluetech
https://github.com/srittau
srittauhttps://github.com/srittau
on Jun 26, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650189844
https://github.com/staticdev
staticdevhttps://github.com/staticdev
on Jun 26, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650204885
@srittauhttps://github.com/srittau
https://github.com/srittau
srittauhttps://github.com/srittau
on Jun 26, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650213029
srittauhttps://github.com/srittau
on Jun 26, 2020https://github.com/python/typeshed/issues/3195#event-3486889756
Add float.__ceil__ and __floor__https://github.com/srittau/typeshed/commit/efe954c841dafd45534b7da9f9eb90749d82bf8b
https://docs.github.com/articles/closing-issues-via-commit-messages
efe954chttps://github.com/srittau/typeshed/commit/efe954c841dafd45534b7da9f9eb90749d82bf8b
JelleZijlstrahttps://github.com/JelleZijlstra
completedhttps://github.com/python/typeshed/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#4274https://github.com/python/typeshed/pull/4274
on Jun 27, 2020https://github.com/python/typeshed/issues/3195#event-3488675302
JelleZijlstrahttps://github.com/JelleZijlstra
on Jun 27, 2020https://github.com/python/typeshed/issues/3195#event-3488675317
Add float.__ceil__ and __floor__ (#4274)https://github.com/python/typeshed/commit/564a8220f4602d546cfa0bc372a96a21584b5a03
#4274https://github.com/python/typeshed/pull/4274
https://docs.github.com/articles/closing-issues-via-commit-messages
564a822https://github.com/python/typeshed/commit/564a8220f4602d546cfa0bc372a96a21584b5a03
https://github.com/bluetech
bluetechhttps://github.com/bluetech
on Jun 28, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650712679
@srittauhttps://github.com/srittau
https://github.com/srittau
srittauhttps://github.com/srittau
on Jun 28, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650729114
https://github.com/bluetech
bluetechhttps://github.com/bluetech
on Jun 28, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650731566
https://github.com/hauntsaninja
hauntsaninjahttps://github.com/hauntsaninja
on Jun 28, 2020https://github.com/python/typeshed/issues/3195#issuecomment-650822207
https://grep.app/search?q=.__floor__%28%29&filter[lang][0]=Pythonhttps://grep.app/search?q=.__floor__%28%29&filter%5Blang%5D%5B0%5D=Python
https://grep.app/search?q=numbers.Real&case=true&filter[lang][0]=Pythonhttps://grep.app/search?q=numbers.Real&case=true&filter%5Blang%5D%5B0%5D=Python
https://github.com/srittau
srittauhttps://github.com/srittau
on Jun 29, 2020https://github.com/python/typeshed/issues/3195#issuecomment-651180150
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/typeshed/issues/3195
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/typeshed/issues/3195
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.