Skip to content

Added 3 new methods to the URL class #45

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

RealA10N
Copy link

First of all, I love this project! It saved me time on my projects, a couple of times already.
However, while using it I thought to myself that there is someplace to improve it.

Added 3 new methods:

  • add_path_segments: To add multiple path segments to the URL at once, instead of using the add_path_segment method multiple times.
  • append_query_params: The same concept - to add multiple query parameters at once.
  • remove_query_params: To remove multiple query parameters at once.

I have also updated the README file to save you some work 😊
Please check my documentation, comments, and docstrings! I tried to follow the original format and syntax, but I'm pretty sure I failed at that 😅

Copy link
Owner

@codeinthehole codeinthehole left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for taking ages to notice this PR.

New methods seem sensible but could you add some tests for them?

segments = self.path_segments()
for value in values:
segments += (to_unicode(value),)
return self.path_segments(segments)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could loop over values and call self.add_path_segment on each right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants