Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: useurlunparse instead of string replace#2221

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nejch merged 1 commit intomainfromjlvillal/unparse
Aug 4, 2022
Merged

Conversation

JohnVillalovos
Copy link
Member

Use theurlunparse() function to reconstruct the URL without the
query parameters.

Use the `urlunparse()` function to reconstruct the URL without thequery parameters.
@nejch
Copy link
Member

@JohnVillalovos this uses a private interface, see my comment at#2219 (comment).

@JohnVillalovos
Copy link
MemberAuthor

@JohnVillalovos this uses a private interface, see my comment at#2219 (comment).

It is documented in the official docs, which to me means it is supposed to be used.

https://docs.python.org/3/library/urllib.parse.html

As is the case with all named tuples, the subclass has a few additional methods and attributes that are particularly useful. One such method is _replace(). The _replace() method will return a new ParseResult object replacing specified fields with new values.

@codecov-commenter
Copy link

Codecov Report

Merging#2221 (6d1b62d) intomain (d263f57) willnot change coverage.
The diff coverage is100.00%.

@@           Coverage Diff           @@##             main    #2221   +/-   ##=======================================  Coverage   95.45%   95.45%           =======================================  Files          81       81             Lines        5368     5368           =======================================  Hits         5124     5124             Misses        244      244
FlagCoverage Δ
api_func_v481.35% <100.00%> (ø)
cli_func_v482.91% <100.00%> (-0.12%)⬇️
unit87.29% <100.00%> (ø)

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
gitlab/client.py98.75% <100.00%> (ø)

@JohnVillalovos
Copy link
MemberAuthor

JohnVillalovos commentedAug 4, 2022
edited
Loading

My theory is that because theurllib.parse.ParseResult is anamedtuple they preface functions with underscores. I don't think it is required but maybe it is "best practice" 🤷‍♂️

Thenamedtuple documentation sort-of mentions that:https://docs.python.org/3/library/collections.html#collections.namedtuple

In addition to the methods inherited from tuples, named tuples support three additional methods and two attributes. To prevent conflicts with field names, the method and attribute names start with an underscore.

@nejch
Copy link
Member

Ok, I will begrudgingly merge this 🐱

@nejchnejch merged commit9e0b60f intomainAug 4, 2022
@nejchnejch deleted the jlvillal/unparse branchAugust 4, 2022 16:06
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

3 participants

@JohnVillalovos@nejch@codecov-commenter

[8]ページ先頭

©2009-2025 Movatter.jp