René's URL Explorer Experiment


Title: Decide to deprecate module level functions? · Issue #225 · python-semver/python-semver · GitHub

Open Graph Title: Decide to deprecate module level functions? · Issue #225 · python-semver/python-semver

X Title: Decide to deprecate module level functions? · Issue #225 · python-semver/python-semver

Description: Situation Currently, we have mostly functions which are either on the module level (semver.next_version, semver.bump_*) and almost the same on the VersionInfo level (semver.VersionInfo.next_version, semver.VersionInfo.bump_*). I know, th...

Open Graph Description: Situation Currently, we have mostly functions which are either on the module level (semver.next_version, semver.bump_*) and almost the same on the VersionInfo level (semver.VersionInfo.next_version...

X Description: Situation Currently, we have mostly functions which are either on the module level (semver.next_version, semver.bump_*) and almost the same on the VersionInfo level (semver.VersionInfo.next_version...

Opengraph URL: https://github.com/python-semver/python-semver/issues/225

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Decide to deprecate module level functions?","articleBody":"## Situation\r\n\r\nCurrently, we have mostly functions which are either on the module level (`semver.next_version`, `semver.bump_*`) and almost the same on the `VersionInfo` level (`semver.VersionInfo.next_version`, `semver.VersionInfo.bump_*`).\r\n\r\nI know, they both serve distinctive purposes: the first expects and returns a string whereas the second needs a `VersionInfo` object.\r\n\r\nHowever, from an implementation perspective, I'm wondering if this is double work. It looks inefficient to me when the `VersionInfo` methods need to convert the object first into a string, call the modul level function, and convert it back to a `VersionInfo` object.\r\n\r\nIMHO, we should improve this situation.\r\n\r\n\r\n## Suggested Solution\r\n\r\nThe question boils down to this: should we treat `VersionInfo` as **first class object**?\r\n\r\nI have the impression this isn't currently the case. The developer can decide between two implementation which does mostly the same. The only difference is, one implementation use strings, the other use a \"detour\" with an `VersionInfo` object.\r\n\r\nIf we would treat `VersionInfo` as our one and only solution, that would mean we have to move the implementation into the methods. The module level functions would serve as \"helper functions\".\r\n\r\nOr... maybe we could think about a more radical approach? Are the module level functions really necessary? Should we deprecate them? As we can convert a `VersionInfo` object into a string through `str(versionobject)`, it seems to me, they are obsolete...\r\n\r\nI see the following benefits of this approach:\r\n\r\n* Focus on the `VersionInfo` class, all the magic would happen there. :wink: \r\n* Avoids writing two functions which mostly implements the same functionality, but with different types.\r\n* Simplifies testing.\r\n* Focus more on objects than strings (which can't be controlled).\r\n* Improves the project to be more slim and well-arranged.\r\n* Makes conversion between objects obsolete. Without conversion, it would have a improved effect on performance (maybe only slightly, but...).\r\n\r\nIf we want to follow this path, we would need:\r\n\r\n* Use the `warning` module to issue a deprecation warning in affected module functions.\r\n* Document the change for our upcoming major release. :wink:\r\n* Release 2.9.2 of semver to implement the warnings\r\n* Make the whole removal in release 3 only.\r\n\r\n@gsakkis, @scls19fr  Does that make sense to you? Do I miss an important point? I would really like to hear your view on this. :heart: \r\n","author":{"url":"https://github.com/tomschr","@type":"Person","name":"tomschr"},"datePublished":"2020-02-29T17:48:27.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":10},"url":"https://github.com/225/python-semver/issues/225"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:45d59e54-f672-0842-6468-849475e2c83f
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id83C2:DD69B:3C0601B:503E931:696F206B
html-safe-noncef444f4bd541693c303b2528c1e95cde7bcf790a103617ecf6a613c86018a1673
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4M0MyOkRENjlCOjNDMDYwMUI6NTAzRTkzMTo2OTZGMjA2QiIsInZpc2l0b3JfaWQiOiIxOTE2NTQ5NDk4ODUwNDUxNTY0IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacdab8809ea7407181e5393f8398d4f5979ed2dbbb0ff0ef7b7e6759c8b9768eca
hovercard-subject-tagissue:573357581
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-semver/python-semver/225/issue_layout
twitter:imagehttps://opengraph.githubassets.com/2f85831c6071e5f5df1c5e13f8c49b04316b1bdd5ba9a0d9ed352ae3b6fa54af/python-semver/python-semver/issues/225
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/2f85831c6071e5f5df1c5e13f8c49b04316b1bdd5ba9a0d9ed352ae3b6fa54af/python-semver/python-semver/issues/225
og:image:altSituation Currently, we have mostly functions which are either on the module level (semver.next_version, semver.bump_*) and almost the same on the VersionInfo level (semver.VersionInfo.next_version...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernametomschr
hostnamegithub.com
expected-hostnamegithub.com
Noneb278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee
turbo-cache-controlno-preview
go-importgithub.com/python-semver/python-semver git https://github.com/python-semver/python-semver.git
octolytics-dimension-user_id57228994
octolytics-dimension-user_loginpython-semver
octolytics-dimension-repository_id3375726
octolytics-dimension-repository_nwopython-semver/python-semver
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3375726
octolytics-dimension-repository_network_root_nwopython-semver/python-semver
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
release39aed5006635ab6f45e6b77d23e73b08a00272a3
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python-semver/python-semver/issues/225#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython-semver%2Fpython-semver%2Fissues%2F225
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%2Fpython-semver%2Fpython-semver%2Fissues%2F225
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=python-semver%2Fpython-semver
Reloadhttps://github.com/python-semver/python-semver/issues/225
Reloadhttps://github.com/python-semver/python-semver/issues/225
Reloadhttps://github.com/python-semver/python-semver/issues/225
python-semver https://github.com/python-semver
python-semverhttps://github.com/python-semver/python-semver
Notifications https://github.com/login?return_to=%2Fpython-semver%2Fpython-semver
Fork 96 https://github.com/login?return_to=%2Fpython-semver%2Fpython-semver
Star 514 https://github.com/login?return_to=%2Fpython-semver%2Fpython-semver
Code https://github.com/python-semver/python-semver
Issues 12 https://github.com/python-semver/python-semver/issues
Pull requests 3 https://github.com/python-semver/python-semver/pulls
Discussions https://github.com/python-semver/python-semver/discussions
Actions https://github.com/python-semver/python-semver/actions
Projects 0 https://github.com/python-semver/python-semver/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python-semver/python-semver/security
Please reload this pagehttps://github.com/python-semver/python-semver/issues/225
Insights https://github.com/python-semver/python-semver/pulse
Code https://github.com/python-semver/python-semver
Issues https://github.com/python-semver/python-semver/issues
Pull requests https://github.com/python-semver/python-semver/pulls
Discussions https://github.com/python-semver/python-semver/discussions
Actions https://github.com/python-semver/python-semver/actions
Projects https://github.com/python-semver/python-semver/projects
Security https://github.com/python-semver/python-semver/security
Insights https://github.com/python-semver/python-semver/pulse
New issuehttps://github.com/login?return_to=https://github.com/python-semver/python-semver/issues/225
New issuehttps://github.com/login?return_to=https://github.com/python-semver/python-semver/issues/225
#229https://github.com/python-semver/python-semver/pull/229
Decide to deprecate module level functions?https://github.com/python-semver/python-semver/issues/225#top
#229https://github.com/python-semver/python-semver/pull/229
EnhancementNot a bug, but increases or improves in value, quality, desirability, or attractivenesshttps://github.com/python-semver/python-semver/issues?q=state%3Aopen%20label%3A%22Enhancement%22
QuestionUnclear or open issue subject for debatehttps://github.com/python-semver/python-semver/issues?q=state%3Aopen%20label%3A%22Question%22
https://github.com/tomschr
https://github.com/tomschr
tomschrhttps://github.com/tomschr
on Feb 29, 2020https://github.com/python-semver/python-semver/issues/225#issue-573357581
@gsakkishttps://github.com/gsakkis
EnhancementNot a bug, but increases or improves in value, quality, desirability, or attractivenesshttps://github.com/python-semver/python-semver/issues?q=state%3Aopen%20label%3A%22Enhancement%22
QuestionUnclear or open issue subject for debatehttps://github.com/python-semver/python-semver/issues?q=state%3Aopen%20label%3A%22Question%22
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.