aio-libs / aio-libs/yarl

More consistent handling of trailing slashes

Open
#1,543 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
1.5k
Forks
215
Avg merge
1d 2m
Merged PRs (30d)
13

Description

### Is your feature request related to a problem?

It’s a follow-up to #1542 –& I hope it doesn’t get nitpicky ;) – these issues just pop up in my unit tests ... I’ve also realized that I’m essentially re-opening #153 w/ this:

```python
>>> URL('http://github.com') == URL('http://github.com/')
True

>>> str(URL('http://github.com')) == str(URL('http://github.com/'))
False
```

### Describe the solution you'd like

Remove trailing slashes in `.__str__()` conversion – or completely, as proposed in https://github.com/aio-libs/yarl/issues/153#issuecomment-357327176

```python
>>> str(URL('http://github.com/'))
'http://github.com'
```

### Describe alternatives you've considered

Using direct `URL` comparison – which leads me back to #1542 ;)

### Additional context

_No response_

### Code of Conduct

- [x] I agree to follow the aio-libs Code of Conduct

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.