Skip to content

Commit

Permalink
Exterminate offensive references from the project
Browse files Browse the repository at this point in the history
This change doesn't edit the test semantics, nor does it make any
functional changes. It removes references to the ruscist culture that
are as triggering to a lot of people as using "slave/master",
"blacklist/whitelist" terminology.

In particular, this gets rid of a link to the website that exists
to justify ethnic cleansing in Crimea and genocides in Ukraine, being
sponsored by the government of the terrorist state of muscovy.

Ref #955 (comment)
  • Loading branch information
webknjaz committed Dec 5, 2023
1 parent 6e61b44 commit 04399eb
Show file tree
Hide file tree
Showing 8 changed files with 182 additions and 169 deletions.
10 changes: 5 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,27 +74,27 @@ automatically encoded giving canonical representation as result:

.. code-block:: pycon
>>> url = URL('https://www.python.org/путь')
>>> url = URL('https://www.python.org/шлях')
>>> url
URL('https://www.python.org/%D0%BF%D1%83%D1%82%D1%8C')
URL('https://www.python.org/%D1%88%D0%BB%D1%8F%D1%85')
Regular properties are *percent-decoded*, use ``raw_`` versions for
getting *encoded* strings:

.. code-block:: pycon
>>> url.path
'/путь'
'/шлях'
>>> url.raw_path
'/%D0%BF%D1%83%D1%82%D1%8C'
'/%D1%88%D0%BB%D1%8F%D1%85'
Human readable representation of URL is available as ``.human_repr()``:

.. code-block:: pycon
>>> url.human_repr()
'https://www.python.org/путь'
'https://www.python.org/шлях'
For full documentation please read https://yarl.aio-libs.org.

Expand Down
4 changes: 2 additions & 2 deletions benchmark.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,14 @@

print(
"Cython quote: {:.3f} sec".format(
timeit.timeit("q(s)", cython_setup + "s='/путь/файл';q=Quoter()")
timeit.timeit("q(s)", cython_setup + "s='/шлях/файл';q=Quoter()")
)
)


print(
"Python quote: {:.3f} sec".format(
timeit.timeit("q(s)", python_setup + "s='/путь/файл';q=Quoter()")
timeit.timeit("q(s)", python_setup + "s='/шлях/файл';q=Quoter()")
)
)

Expand Down
100 changes: 50 additions & 50 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ But for *non-ascii* case *encoding* is applied.

.. doctest::

>>> str(URL('http://εμπορικόσήμα.eu/путь/這裡'))
'http://xn--jxagkqfkduily1i.eu/%D0%BF%D1%83%D1%82%D1%8C/%E9%80%99%E8%A3%A1'
>>> str(URL('http://εμπορικόσήμα.eu/шлях/這裡'))
'http://xn--jxagkqfkduily1i.eu/%D1%88%D0%BB%D1%8F%D1%85/%E9%80%99%E8%A3%A1'

The same is true for *user*, *password*, *query* and *fragment* parts of URL.

Expand All @@ -70,11 +70,11 @@ Use :meth:`~URL.human_repr` for getting human readable representation:

.. doctest::

>>> url = URL('http://εμπορικόσήμα.eu/путь/這裡')
>>> url = URL('http://εμπορικόσήμα.eu/шлях/這裡')
>>> str(url)
'http://xn--jxagkqfkduily1i.eu/%D0%BF%D1%83%D1%82%D1%8C/%E9%80%99%E8%A3%A1'
'http://xn--jxagkqfkduily1i.eu/%D1%88%D0%BB%D1%8F%D1%85/%E9%80%99%E8%A3%A1'
>>> url.human_repr()
'http://εμπορικόσήμα.eu/путь/這裡'
'http://εμπορικόσήμα.eu/шлях/這裡'


.. note::
Expand Down Expand Up @@ -120,8 +120,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

>>> URL('http://john@example.com').user
'john'
>>> URL('http://андрей@example.com').user
'андрей'
>>> URL('http://бажан@example.com').user
'бажан'
>>> URL('http://example.com').user is None
True

Expand All @@ -133,8 +133,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

.. doctest::

>>> URL('http://андрей@example.com').raw_user
'%D0%B0%D0%BD%D0%B4%D1%80%D0%B5%D0%B9'
>>> URL('http://довбуш@example.com').raw_user
'%D0%B4%D0%BE%D0%B2%D0%B1%D1%83%D1%88'
>>> URL('http://example.com').raw_user is None
True

Expand All @@ -147,7 +147,7 @@ There are two kinds of properties: *decoded* and *encoded* (with

>>> URL('http://john:pass@example.com').password
'pass'
>>> URL('http://андрей:пароль@example.com').password
>>> URL('http://степан:пароль@example.com').password
'пароль'
>>> URL('http://example.com').password is None
True
Expand Down Expand Up @@ -265,8 +265,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

>>> URL('http://example.com/path/to').path
'/path/to'
>>> URL('http://example.com/путь/сюда').path
'/путь/сюда'
>>> URL('http://example.com/шлях/сюди').path
'/шлях/сюди'
>>> URL('http://example.com').path
'/'

Expand All @@ -287,8 +287,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

.. doctest::

>>> URL('http://example.com/путь/сюда?ключ=знач').raw_path_qs
'/%D0%BF%D1%83%D1%82%D1%8C/%D1%81%D1%8E%D0%B4%D0%B0?%D0%BA%D0%BB%D1%8E%D1%87=%D0%B7%D0%BD%D0%B0%D1%87'
>>> URL('http://example.com/шлях/сюди?ключ=знач').raw_path_qs
'/%D1%88%D0%BB%D1%8F%D1%85/%D1%81%D1%8E%D0%B4%D0%B8?%D0%BA%D0%BB%D1%8E%D1%87=%D0%B7%D0%BD%D0%B0%D1%87'

.. versionadded:: 0.15

Expand All @@ -298,8 +298,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

.. doctest::

>>> URL('http://example.com/путь/сюда').raw_path
'/%D0%BF%D1%83%D1%82%D1%8C/%D1%81%D1%8E%D0%B4%D0%B0'
>>> URL('http://example.com/шлях/сюди').raw_path
'/%D1%88%D0%BB%D1%8F%D1%85/%D1%81%D1%8E%D0%B4%D0%B8'


.. attribute:: URL.query_string
Expand Down Expand Up @@ -333,8 +333,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

>>> URL('http://example.com/path#fragment').fragment
'fragment'
>>> URL('http://example.com/path#якорь').fragment
'якорь'
>>> URL('http://example.com/path#якір').fragment
'якір'
>>> URL('http://example.com/path').fragment
''

Expand All @@ -344,8 +344,8 @@ There are two kinds of properties: *decoded* and *encoded* (with

.. doctest::

>>> URL('http://example.com/path#якорь').raw_fragment
'%D1%8F%D0%BA%D0%BE%D1%80%D1%8C'
>>> URL('http://example.com/path#якір').raw_fragment
'%D1%8F%D0%BA%D1%96%D1%80'



Expand All @@ -361,8 +361,8 @@ For *path* and *query* *yarl* supports additional helpers:

>>> URL('http://example.com/path/to').parts
('/', 'path', 'to')
>>> URL('http://example.com/путь/сюда').parts
('/', 'путь', 'сюда')
>>> URL('http://example.com/шлях/сюди').parts
('/', 'шлях', 'сюди')
>>> URL('http://example.com').parts
('/',)

Expand All @@ -373,8 +373,8 @@ For *path* and *query* *yarl* supports additional helpers:

.. doctest::

>>> URL('http://example.com/путь/сюда').raw_parts
('/', '%D0%BF%D1%83%D1%82%D1%8C', '%D1%81%D1%8E%D0%B4%D0%B0')
>>> URL('http://example.com/шлях/сюди').raw_parts
('/', '%D1%88%D0%BB%D1%8F%D1%85', '%D1%81%D1%8E%D0%B4%D0%B8')

.. attribute:: URL.name

Expand All @@ -384,8 +384,8 @@ For *path* and *query* *yarl* supports additional helpers:

>>> URL('http://example.com/path/to').name
'to'
>>> URL('http://example.com/путь/сюда').name
'сюда'
>>> URL('http://example.com/шлях/сюди').name
'сюди'
>>> URL('http://example.com/path/').name
''

Expand All @@ -395,8 +395,8 @@ For *path* and *query* *yarl* supports additional helpers:

.. doctest::

>>> URL('http://example.com/путь/сюда').raw_name
'%D1%81%D1%8E%D0%B4%D0%B0'
>>> URL('http://example.com/шлях/сюди').raw_name
'%D1%81%D1%8E%D0%B4%D0%B8'

.. attribute:: URL.suffix

Expand All @@ -406,8 +406,8 @@ For *path* and *query* *yarl* supports additional helpers:

>>> URL('http://example.com/path/to.txt').suffix
'.txt'
>>> URL('http://example.com/путь.сюда').suffix
'.сюда'
>>> URL('http://example.com/шлях.сюди').suffix
'.сюди'
>>> URL('http://example.com/path').suffix
''

Expand All @@ -417,8 +417,8 @@ For *path* and *query* *yarl* supports additional helpers:

.. doctest::

>>> URL('http://example.com/путь.сюда').raw_suffix
'.%D1%81%D1%8E%D0%B4%D0%B0'
>>> URL('http://example.com/шлях.сюди').raw_suffix
'.%D1%81%D1%8E%D0%B4%D0%B8'

.. attribute:: URL.suffixes

Expand All @@ -428,8 +428,8 @@ For *path* and *query* *yarl* supports additional helpers:

>>> URL('http://example.com/path/to.tar.gz').suffixes
('.tar', '.gz')
>>> URL('http://example.com/путь.тут.да').suffixes
('.тут', '.да')
>>> URL('http://example.com/шлях.тут.ось').suffixes
('.тут', '.ось')
>>> URL('http://example.com/path').suffixes
()

Expand All @@ -439,8 +439,8 @@ For *path* and *query* *yarl* supports additional helpers:

.. doctest::

>>> URL('http://example.com/путь.тут.да').raw_suffixes
('.%D1%82%D1%83%D1%82', '.%D0%B4%D0%B0')
>>> URL('http://example.com/шлях.тут.ось').raw_suffixes
('.%D1%82%D1%83%D1%82', '.%D0%BE%D1%81%D1%8C')


.. attribute:: URL.query
Expand Down Expand Up @@ -546,8 +546,8 @@ section generates a new :class:`URL` instance.

>>> URL('http://user:pass@example.com').with_user('new_user')
URL('http://new_user:pass@example.com')
>>> URL('http://user:pass@example.com').with_user('вася')
URL('http://%D0%B2%D0%B0%D1%81%D1%8F:pass@example.com')
>>> URL('http://user:pass@example.com').with_user('олекса')
URL('http://%D0%BE%D0%BB%D0%B5%D0%BA%D1%81%D0%B0:pass@example.com')
>>> URL('http://user:pass@example.com').with_user(None)
URL('http://example.com')

Expand Down Expand Up @@ -739,8 +739,8 @@ section generates a new :class:`URL` instance.

>>> URL('http://example.com/path#frag').with_fragment('anchor')
URL('http://example.com/path#anchor')
>>> URL('http://example.com/path#frag').with_fragment('якорь')
URL('http://example.com/path#%D1%8F%D0%BA%D0%BE%D1%80%D1%8C')
>>> URL('http://example.com/path#frag').with_fragment('якір')
URL('http://example.com/path#%D1%8F%D0%BA%D1%96%D1%80')
>>> URL('http://example.com/path#frag').with_fragment(None)
URL('http://example.com/path')

Expand All @@ -755,8 +755,8 @@ section generates a new :class:`URL` instance.

>>> URL('http://example.com/path/to?arg#frag').with_name('new')
URL('http://example.com/path/new')
>>> URL('http://example.com/path/to').with_name('имя')
URL('http://example.com/path/%D0%B8%D0%BC%D1%8F')
>>> URL('http://example.com/path/to').with_name("ім'я")
URL('http://example.com/path/%D1%96%D0%BC%27%D1%8F')

.. method:: URL.with_suffix(suffix)

Expand All @@ -769,8 +769,8 @@ section generates a new :class:`URL` instance.

>>> URL('http://example.com/path/to?arg#frag').with_suffix('.doc')
URL('http://example.com/path/to.doc')
>>> URL('http://example.com/path/to').with_suffix('.cуффикс')
URL('http://example.com/path/to.c%D1%83%D1%84%D1%84%D0%B8%D0%BA%D1%81')
>>> URL('http://example.com/path/to').with_suffix('.cуфікс')
URL('http://example.com/path/to.c%D1%83%D1%84%D1%96%D0%BA%D1%81')

.. attribute:: URL.parent

Expand Down Expand Up @@ -816,9 +816,9 @@ The path is encoded if needed.
URL('http://example.com/path/to/subpath')
>>> url.parts
('/', 'path', 'to', 'subpath')
>>> url = URL('http://example.com/path?arg#frag') / 'сюда'
>>> url = URL('http://example.com/path?arg#frag') / 'сюди'
>>> url
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B0')
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B8')

.. method:: URL.joinpath(*other, encoded=False)

Expand All @@ -835,12 +835,12 @@ The path is encoded if needed.
URL('http://example.com/path/to/subpath')
>>> url.parts
('/', 'path', 'to', 'subpath')
>>> url = URL('http://example.com/path?arg#frag').joinpath('сюда')
>>> url = URL('http://example.com/path?arg#frag').joinpath('сюди')
>>> url
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B0')
>>> url = URL('http://example.com/path').joinpath('%D1%81%D1%8E%D0%B4%D0%B0', encoded=True)
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B8')
>>> url = URL('http://example.com/path').joinpath('%D1%81%D1%8E%D0%B4%D0%B8', encoded=True)
>>> url
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B0')
URL('http://example.com/path/%D1%81%D1%8E%D0%B4%D0%B8')

.. versionadded:: 1.9

Expand Down
10 changes: 5 additions & 5 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,27 @@ automatically encoded giving canonical representation as result:

.. doctest::

>>> url = URL('https://www.python.org/путь')
>>> url = URL('https://www.python.org/шлях')
>>> url
URL('https://www.python.org/%D0%BF%D1%83%D1%82%D1%8C')
URL('https://www.python.org/%D1%88%D0%BB%D1%8F%D1%85')

Regular properties are *percent-decoded*, use ``raw_`` versions for
getting *encoded* strings:

.. doctest::

>>> url.path
'/путь'
'/шлях'

>>> url.raw_path
'/%D0%BF%D1%83%D1%82%D1%8C'
'/%D1%88%D0%BB%D1%8F%D1%85'

Human readable representation of URL is available as :meth:`~yarl.URL.human_repr`:

.. doctest::

>>> url.human_repr()
'https://www.python.org/путь'
'https://www.python.org/шлях'

For full documentation please read :ref:`yarl-api` section.

Expand Down
Loading

0 comments on commit 04399eb

Please sign in to comment.