[Python-modules-commits] [yarl] 01/09: Import yarl_0.13.0.orig.tar.gz

Piotr Ożarowski piotr at moszumanska.debian.org
Wed Oct 25 09:11:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

piotr pushed a commit to branch master
in repository yarl.

commit e408f9248fb467da0cf7adea1f8804f2128f12a4
Author: Piotr Ożarowski <piotr at debian.org>
Date:   Wed Oct 25 11:04:24 2017 +0200

    Import yarl_0.13.0.orig.tar.gz
---
 CHANGES.rst                     |  63 +--
 PKG-INFO                        |  65 ++--
 docs/api.rst                    |  17 +-
 tests/test_update_query.py      |  22 +-
 tests/test_url.py               |  10 +
 tests/test_url_build.py         |   8 +
 tests/test_url_update_netloc.py |   6 +-
 yarl.egg-info/PKG-INFO          |  65 ++--
 yarl/__init__.py                |  25 +-
 yarl/__init__.pyi               |  27 +-
 yarl/_quoting.c                 | 842 +++++++++++++++++++++++++++++-----------
 yarl/_quoting.pyi               |   4 +-
 12 files changed, 807 insertions(+), 347 deletions(-)

diff --git a/CHANGES.rst b/CHANGES.rst
index 139777a..b9e52ec 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -1,45 +1,56 @@
 CHANGES
 =======
 
+0.13.0 (2017-10-01)
+-------------------
+
+* Document `encoded` parameter (#102)
+
+* Support relative urls like `'?key=value'` (#100)
+
+* Unsafe encoding for QS fixed. Encode `;` char in value param (#104)
+
+* Process passwords without user names (#95)
+
 0.12.0 (2017-06-26)
 -------------------
 
-* Properly support paths without leading slash in `URL.with_path()` #90
+* Properly support paths without leading slash in `URL.with_path()` (#90)
 
 * Enable type annotation checks
 
 0.11.0 (2017-06-26)
 -------------------
 
-* Normalize path #86
+* Normalize path (#86)
 
-* Clear query and fragment parts in `.with_path()` #85
+* Clear query and fragment parts in `.with_path()` (#85)
 
 0.10.3 (2017-06-13)
 -------------------
 
-* Prevent double URL args unquoting #83
+* Prevent double URL args unquoting (#83)
 
 0.10.2 (2017-05-05)
 -------------------
 
-* Unexpected hash behaviour #75
+* Unexpected hash behaviour (#75)
 
 
 0.10.1 (2017-05-03)
 -------------------
 
-* Unexpected compare behaviour #73
+* Unexpected compare behaviour (#73)
 
-* Do not quote or unquote + if not a query string. #74
+* Do not quote or unquote + if not a query string. (#74)
 
 
 0.10.0 (2017-03-14)
 -------------------
 
-* Added `URL.build` class method #58
+* Added `URL.build` class method (#58)
 
-* Added `path_qs` attribute #42
+* Added `path_qs` attribute (#42)
 
 
 0.9.8 (2017-02-16)
@@ -51,9 +62,9 @@ CHANGES
 0.9.7 (2017-02-16)
 ------------------
 
-* Load from pickle without _cache #56
+* Load from pickle without _cache (#56)
 
-* Percent-encoded pluses in path variables become spaces #59
+* Percent-encoded pluses in path variables become spaces (#59)
 
 
 0.9.6 (2017-02-15)
@@ -89,23 +100,23 @@ CHANGES
 0.9.1 (2017-02-07)
 ------------------
 
-* Do not lose tail chars #45
+* Do not lose tail chars (#45)
 
 
 0.9.0 (2017-02-07)
 ------------------
 
-* Allow to quote % in non strict mode #21
+* Allow to quote % in non strict mode (#21)
 
-* Incorrect parsing of query parameters with %3B (;) inside #34
+* Incorrect parsing of query parameters with %3B (;) inside (#34)
 
-* core dumps #41
+* core dumps (#41)
 
-* tmpbuf - compiling error #43
+* tmpbuf - compiling error (#43)
 
 * Added `URL.update_path()` method
 
-* Added `URL.update_query()` method #47
+* Added `URL.update_query()` method (#47)
 
 
 0.8.1 (2016-12-03)
@@ -117,9 +128,9 @@ CHANGES
 0.8.0 (2016-12-03)
 ------------------
 
-* Support more verbose error messages in `.with_query()` #24
+* Support more verbose error messages in `.with_query()` (#24)
 
-* Don't percent-encode `@` and `:` in path #32
+* Don't percent-encode `@` and `:` in path (#32)
 
 * Don't expose `yarl.quote` and `yarl.unquote`, these functions are
   part of private API
@@ -127,7 +138,7 @@ CHANGES
 0.7.1 (2016-11-18)
 ------------------
 
-* Accept not only `str` but all classes inherited from `str` also #25
+* Accept not only `str` but all classes inherited from `str` also (#25)
 
 0.7.0 (2016-11-07)
 ------------------
@@ -137,8 +148,8 @@ CHANGES
 0.6.0 (2016-11-07)
 ------------------
 
-* Explicitly use UTF8 encoding in setup.py #20
-* Properly unquote non-UTF8 strings #19
+* Explicitly use UTF8 encoding in setup.py (#20)
+* Properly unquote non-UTF8 strings (#19)
 
 0.5.3 (2016-11-02)
 ------------------
@@ -179,7 +190,7 @@ CHANGES
 0.4.0 (2016-09-27)
 ------------------
 
-* Introduce relative() #16
+* Introduce relative() (#16)
 
 0.3.2 (2016-09-27)
 ------------------
@@ -204,14 +215,14 @@ CHANGES
 0.2.0 (2016-09-18)
 ------------------
 
-* Avoid doubling slashes when joining paths #13
+* Avoid doubling slashes when joining paths (#13)
 
-* Appending path starting from slash is forbidden #12
+* Appending path starting from slash is forbidden (#12)
 
 0.1.4 (2016-09-09)
 ------------------
 
-* Add kwargs support for with_query() #10
+* Add kwargs support for with_query() (#10)
 
 0.1.3 (2016-09-07)
 ------------------
diff --git a/PKG-INFO b/PKG-INFO
index 8fc2ed9..796a1de 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: yarl
-Version: 0.12.0
+Version: 0.13.0
 Summary: Yet another URL library
 Home-page: https://github.com/aio-libs/yarl/
 Author: Andrew Svetlov
@@ -167,45 +167,56 @@ Description: yarl
         CHANGES
         =======
         
+        0.13.0 (2017-10-01)
+        -------------------
+        
+        * Document `encoded` parameter (#102)
+        
+        * Support relative urls like `'?key=value'` (#100)
+        
+        * Unsafe encoding for QS fixed. Encode `;` char in value param (#104)
+        
+        * Process passwords without user names (#95)
+        
         0.12.0 (2017-06-26)
         -------------------
         
-        * Properly support paths without leading slash in `URL.with_path()` #90
+        * Properly support paths without leading slash in `URL.with_path()` (#90)
         
         * Enable type annotation checks
         
         0.11.0 (2017-06-26)
         -------------------
         
-        * Normalize path #86
+        * Normalize path (#86)
         
-        * Clear query and fragment parts in `.with_path()` #85
+        * Clear query and fragment parts in `.with_path()` (#85)
         
         0.10.3 (2017-06-13)
         -------------------
         
-        * Prevent double URL args unquoting #83
+        * Prevent double URL args unquoting (#83)
         
         0.10.2 (2017-05-05)
         -------------------
         
-        * Unexpected hash behaviour #75
+        * Unexpected hash behaviour (#75)
         
         
         0.10.1 (2017-05-03)
         -------------------
         
-        * Unexpected compare behaviour #73
+        * Unexpected compare behaviour (#73)
         
-        * Do not quote or unquote + if not a query string. #74
+        * Do not quote or unquote + if not a query string. (#74)
         
         
         0.10.0 (2017-03-14)
         -------------------
         
-        * Added `URL.build` class method #58
+        * Added `URL.build` class method (#58)
         
-        * Added `path_qs` attribute #42
+        * Added `path_qs` attribute (#42)
         
         
         0.9.8 (2017-02-16)
@@ -217,9 +228,9 @@ Description: yarl
         0.9.7 (2017-02-16)
         ------------------
         
-        * Load from pickle without _cache #56
+        * Load from pickle without _cache (#56)
         
-        * Percent-encoded pluses in path variables become spaces #59
+        * Percent-encoded pluses in path variables become spaces (#59)
         
         
         0.9.6 (2017-02-15)
@@ -255,23 +266,23 @@ Description: yarl
         0.9.1 (2017-02-07)
         ------------------
         
-        * Do not lose tail chars #45
+        * Do not lose tail chars (#45)
         
         
         0.9.0 (2017-02-07)
         ------------------
         
-        * Allow to quote % in non strict mode #21
+        * Allow to quote % in non strict mode (#21)
         
-        * Incorrect parsing of query parameters with %3B (;) inside #34
+        * Incorrect parsing of query parameters with %3B (;) inside (#34)
         
-        * core dumps #41
+        * core dumps (#41)
         
-        * tmpbuf - compiling error #43
+        * tmpbuf - compiling error (#43)
         
         * Added `URL.update_path()` method
         
-        * Added `URL.update_query()` method #47
+        * Added `URL.update_query()` method (#47)
         
         
         0.8.1 (2016-12-03)
@@ -283,9 +294,9 @@ Description: yarl
         0.8.0 (2016-12-03)
         ------------------
         
-        * Support more verbose error messages in `.with_query()` #24
+        * Support more verbose error messages in `.with_query()` (#24)
         
-        * Don't percent-encode `@` and `:` in path #32
+        * Don't percent-encode `@` and `:` in path (#32)
         
         * Don't expose `yarl.quote` and `yarl.unquote`, these functions are
           part of private API
@@ -293,7 +304,7 @@ Description: yarl
         0.7.1 (2016-11-18)
         ------------------
         
-        * Accept not only `str` but all classes inherited from `str` also #25
+        * Accept not only `str` but all classes inherited from `str` also (#25)
         
         0.7.0 (2016-11-07)
         ------------------
@@ -303,8 +314,8 @@ Description: yarl
         0.6.0 (2016-11-07)
         ------------------
         
-        * Explicitly use UTF8 encoding in setup.py #20
-        * Properly unquote non-UTF8 strings #19
+        * Explicitly use UTF8 encoding in setup.py (#20)
+        * Properly unquote non-UTF8 strings (#19)
         
         0.5.3 (2016-11-02)
         ------------------
@@ -345,7 +356,7 @@ Description: yarl
         0.4.0 (2016-09-27)
         ------------------
         
-        * Introduce relative() #16
+        * Introduce relative() (#16)
         
         0.3.2 (2016-09-27)
         ------------------
@@ -370,14 +381,14 @@ Description: yarl
         0.2.0 (2016-09-18)
         ------------------
         
-        * Avoid doubling slashes when joining paths #13
+        * Avoid doubling slashes when joining paths (#13)
         
-        * Appending path starting from slash is forbidden #12
+        * Appending path starting from slash is forbidden (#12)
         
         0.1.4 (2016-09-09)
         ------------------
         
-        * Add kwargs support for with_query() #10
+        * Add kwargs support for with_query() (#10)
         
         0.1.3 (2016-09-07)
         ------------------
diff --git a/docs/api.rst b/docs/api.rst
index 232e54d..33f3835 100644
--- a/docs/api.rst
+++ b/docs/api.rst
@@ -14,7 +14,7 @@ The only public *yarl* class is ``URL``:
    >>> from yarl import URL
 
 
-.. class:: URL(arg)
+.. class:: URL(arg, *, encoded=False)
 
 Represents URL as ::
 
@@ -68,6 +68,21 @@ Use :meth:`URL.human_repr` for getting human readable representation:
    >>> url.human_repr()
    'http://εμπορικόσήμα.eu/путь/這裡'
 
+
+.. note::
+
+   Sometimes encoding performed by *yarl* is not acceptable for
+   certain WEB server.
+
+   Passing ``encoded=True`` parameter prevents URL autoencoding, user is
+   responsible about URL correctness.
+
+   Don't use this option unless there is no other way for keeping URL
+   attributes not touched.
+
+   Any URL manipulations don't guarantee correct encoding, URL parts
+   could be requoted even if *encoded* parameter was explicitly set.
+
 URL properties
 --------------
 
diff --git a/tests/test_update_query.py b/tests/test_update_query.py
index 6c4bdce..d7e45ba 100644
--- a/tests/test_update_query.py
+++ b/tests/test_update_query.py
@@ -113,10 +113,10 @@ def test_with_multidict_with_spaces_and_non_ascii():
 
 def test_with_query_multidict_with_unsafe():
     url = URL('http://example.com/path')
-    url2 = url.with_query({'a+b': '?=+&'})
-    assert url2.raw_query_string == 'a%2Bb=?%3D%2B%26'
-    assert url2.query_string == 'a%2Bb=?%3D%2B%26'
-    assert url2.query == {'a+b': '?=+&'}
+    url2 = url.with_query({'a+b': '?=+&;'})
+    assert url2.raw_query_string == 'a%2Bb=?%3D%2B%26%3B'
+    assert url2.query_string == 'a%2Bb=?%3D%2B%26%3B'
+    assert url2.query == {'a+b': '?=+&;'}
 
 
 def test_with_query_None():
@@ -151,4 +151,16 @@ def test_with_query_memoryview():
 def test_with_query_params():
     url = URL('http://example.com/get')
     url2 = url.with_query([('key', '1;2;3')])
-    assert str(url2) == 'http://example.com/get?key=1;2;3'
+    assert str(url2) == 'http://example.com/get?key=1%3B2%3B3'
+
+
+def test_with_query_params2():
+    url = URL('http://example.com/get')
+    url2 = url.with_query({'key': '1;2;3'})
+    assert str(url2) == 'http://example.com/get?key=1%3B2%3B3'
+
+
+def test_with_query_only():
+    url = URL()
+    url2 = url.with_query(key='value')
+    assert str(url2) == '?key=value'
diff --git a/tests/test_url.py b/tests/test_url.py
index b5d365e..d2582ff 100644
--- a/tests/test_url.py
+++ b/tests/test_url.py
@@ -77,6 +77,11 @@ def test_raw_user_non_ascii():
     assert '%D0%B2%D0%B0%D1%81%D1%8F' == url.raw_user
 
 
+def test_no_user():
+    url = URL('http://example.com')
+    assert url.user is None
+
+
 def test_user_non_ascii():
     url = URL('http://вася@example.com')
     assert 'вася' == url.user
@@ -97,6 +102,11 @@ def test_password_non_ascii():
     assert 'пароль' == url.password
 
 
+def test_password_without_user():
+    url = URL('http://:password@example.com')
+    assert 'password' == url.password
+
+
 def test_raw_host():
     url = URL('http://example.com')
     assert "example.com" == url.raw_host
diff --git a/tests/test_url_build.py b/tests/test_url_build.py
index b1c91cc..35c1e99 100644
--- a/tests/test_url_build.py
+++ b/tests/test_url_build.py
@@ -115,6 +115,14 @@ def test_build_query_quoting():
                       'arg=%D0%9F%D1%80%D0%B8%D0%B2%D0%B5%D1%82')
 
 
+def test_build_query_only():
+    u = URL.build(
+        query={'key': 'value'},
+    )
+
+    assert str(u) == '?key=value'
+
+
 def test_build_drop_dots():
     u = URL.build(
         scheme='http',
diff --git a/tests/test_url_update_netloc.py b/tests/test_url_update_netloc.py
index 9790dd4..46bdab0 100644
--- a/tests/test_url_update_netloc.py
+++ b/tests/test_url_update_netloc.py
@@ -90,8 +90,10 @@ def test_with_password_invalid_type():
 
 def test_with_password_and_empty_user():
     url = URL('http://example.com')
-    with pytest.raises(ValueError):
-        assert str(url.with_password('pass'))
+    url2 = url.with_password('pass')
+    assert url2.password == 'pass'
+    assert url2.user is None
+    assert str(url2) == 'http://:pass@example.com'
 
 
 def test_from_str_with_host_ipv4():
diff --git a/yarl.egg-info/PKG-INFO b/yarl.egg-info/PKG-INFO
index 8fc2ed9..796a1de 100644
--- a/yarl.egg-info/PKG-INFO
+++ b/yarl.egg-info/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: yarl
-Version: 0.12.0
+Version: 0.13.0
 Summary: Yet another URL library
 Home-page: https://github.com/aio-libs/yarl/
 Author: Andrew Svetlov
@@ -167,45 +167,56 @@ Description: yarl
         CHANGES
         =======
         
+        0.13.0 (2017-10-01)
+        -------------------
+        
+        * Document `encoded` parameter (#102)
+        
+        * Support relative urls like `'?key=value'` (#100)
+        
+        * Unsafe encoding for QS fixed. Encode `;` char in value param (#104)
+        
+        * Process passwords without user names (#95)
+        
         0.12.0 (2017-06-26)
         -------------------
         
-        * Properly support paths without leading slash in `URL.with_path()` #90
+        * Properly support paths without leading slash in `URL.with_path()` (#90)
         
         * Enable type annotation checks
         
         0.11.0 (2017-06-26)
         -------------------
         
-        * Normalize path #86
+        * Normalize path (#86)
         
-        * Clear query and fragment parts in `.with_path()` #85
+        * Clear query and fragment parts in `.with_path()` (#85)
         
         0.10.3 (2017-06-13)
         -------------------
         
-        * Prevent double URL args unquoting #83
+        * Prevent double URL args unquoting (#83)
         
         0.10.2 (2017-05-05)
         -------------------
         
-        * Unexpected hash behaviour #75
+        * Unexpected hash behaviour (#75)
         
         
         0.10.1 (2017-05-03)
         -------------------
         
-        * Unexpected compare behaviour #73
+        * Unexpected compare behaviour (#73)
         
-        * Do not quote or unquote + if not a query string. #74
+        * Do not quote or unquote + if not a query string. (#74)
         
         
         0.10.0 (2017-03-14)
         -------------------
         
-        * Added `URL.build` class method #58
+        * Added `URL.build` class method (#58)
         
-        * Added `path_qs` attribute #42
+        * Added `path_qs` attribute (#42)
         
         
         0.9.8 (2017-02-16)
@@ -217,9 +228,9 @@ Description: yarl
         0.9.7 (2017-02-16)
         ------------------
         
-        * Load from pickle without _cache #56
+        * Load from pickle without _cache (#56)
         
-        * Percent-encoded pluses in path variables become spaces #59
+        * Percent-encoded pluses in path variables become spaces (#59)
         
         
         0.9.6 (2017-02-15)
@@ -255,23 +266,23 @@ Description: yarl
         0.9.1 (2017-02-07)
         ------------------
         
-        * Do not lose tail chars #45
+        * Do not lose tail chars (#45)
         
         
         0.9.0 (2017-02-07)
         ------------------
         
-        * Allow to quote % in non strict mode #21
+        * Allow to quote % in non strict mode (#21)
         
-        * Incorrect parsing of query parameters with %3B (;) inside #34
+        * Incorrect parsing of query parameters with %3B (;) inside (#34)
         
-        * core dumps #41
+        * core dumps (#41)
         
-        * tmpbuf - compiling error #43
+        * tmpbuf - compiling error (#43)
         
         * Added `URL.update_path()` method
         
-        * Added `URL.update_query()` method #47
+        * Added `URL.update_query()` method (#47)
         
         
         0.8.1 (2016-12-03)
@@ -283,9 +294,9 @@ Description: yarl
         0.8.0 (2016-12-03)
         ------------------
         
-        * Support more verbose error messages in `.with_query()` #24
+        * Support more verbose error messages in `.with_query()` (#24)
         
-        * Don't percent-encode `@` and `:` in path #32
+        * Don't percent-encode `@` and `:` in path (#32)
         
         * Don't expose `yarl.quote` and `yarl.unquote`, these functions are
           part of private API
@@ -293,7 +304,7 @@ Description: yarl
         0.7.1 (2016-11-18)
         ------------------
         
-        * Accept not only `str` but all classes inherited from `str` also #25
+        * Accept not only `str` but all classes inherited from `str` also (#25)
         
         0.7.0 (2016-11-07)
         ------------------
@@ -303,8 +314,8 @@ Description: yarl
         0.6.0 (2016-11-07)
         ------------------
         
-        * Explicitly use UTF8 encoding in setup.py #20
-        * Properly unquote non-UTF8 strings #19
+        * Explicitly use UTF8 encoding in setup.py (#20)
+        * Properly unquote non-UTF8 strings (#19)
         
         0.5.3 (2016-11-02)
         ------------------
@@ -345,7 +356,7 @@ Description: yarl
         0.4.0 (2016-09-27)
         ------------------
         
-        * Introduce relative() #16
+        * Introduce relative() (#16)
         
         0.3.2 (2016-09-27)
         ------------------
@@ -370,14 +381,14 @@ Description: yarl
         0.2.0 (2016-09-18)
         ------------------
         
-        * Avoid doubling slashes when joining paths #13
+        * Avoid doubling slashes when joining paths (#13)
         
-        * Appending path starting from slash is forbidden #12
+        * Appending path starting from slash is forbidden (#12)
         
         0.1.4 (2016-09-09)
         ------------------
         
-        * Add kwargs support for with_query() #10
+        * Add kwargs support for with_query() (#10)
         
         0.1.3 (2016-09-07)
         ------------------
diff --git a/yarl/__init__.py b/yarl/__init__.py
index 9c0ca4e..5b7eae8 100644
--- a/yarl/__init__.py
+++ b/yarl/__init__.py
@@ -10,7 +10,7 @@ from multidict import MultiDict, MultiDictProxy
 
 from .quoting import quote, unquote
 
-__version__ = '0.12.0'
+__version__ = '0.13.0'
 
 __all__ = ['URL']
 
@@ -176,8 +176,11 @@ class URL:
                     netloc += ':{}'.format(val.port)
                 if val.username:
                     user = _quote(val.username)
-                    if val.password:
-                        user += ':' + _quote(val.password)
+                else:
+                    user = ''
+                if val.password:
+                    user += ':' + _quote(val.password)
+                if user:
                     netloc = user + '@' + netloc
 
             path = _quote(val[2], safe='+@:', protected='/+', strict=strict)
@@ -380,7 +383,10 @@ class URL:
 
         """
         # not .username
-        return self._val.username
+        ret = self._val.username
+        if not ret:
+            return None
+        return ret
 
     @cached_property
     def user(self):
@@ -590,7 +596,7 @@ class URL:
             ret = ret + ':' + str(port)
         if password:
             if not user:
-                raise ValueError("Non-empty password requires non-empty user")
+                user = ''
             user = user + ':' + password
         if user:
             ret = user + '@' + ret
@@ -760,7 +766,7 @@ class URL:
                 else:
                     raise TypeError("Invalid variable type: mapping value "
                                     "should be str or int, got {!r}".format(v))
-                lst.append(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@;'))
+                lst.append(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@'))
                 query = '&'.join(lst)
         elif isinstance(query, str):
             query = _quote(query, safe='/?:@',
@@ -771,16 +777,13 @@ class URL:
                             "memoryview are forbidden")
         elif isinstance(query, Sequence):
             quoter = partial(_quote, qs=True, strict=self._strict)
-            query = '&'.join(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@;')
+            query = '&'.join(quoter(k, safe='/?:@')+'='+quoter(v, safe='/?:@')
                              for k, v in query)
         else:
             raise TypeError("Invalid query type: only str, mapping or "
                             "sequence of (str, str) pairs is allowed")
-        path = self._val.path
-        if path == '':
-            path = '/'
         return URL(
-            self._val._replace(path=path, query=query), encoded=True)
+            self._val._replace(path=self._val.path, query=query), encoded=True)
 
     def update_query(self, *args, **kwargs):
         """Return a new URL with query part updated."""
diff --git a/yarl/__init__.pyi b/yarl/__init__.pyi
index f691428..dccf0a9 100644
--- a/yarl/__init__.pyi
+++ b/yarl/__init__.pyi
@@ -1,4 +1,4 @@
-from typing import overload, Tuple, Optional, Mapping, Union, Sequence
+from typing import overload, Any, Tuple, Optional, Mapping, Union, Sequence
 import multidict
 
 
@@ -15,6 +15,7 @@ class URL:
     path = ...  # type: str
     raw_query_string = ...  # type: str
     query_string = ...  # type: str
+    path_qs = ...  # type: str
     raw_fragment = ...  # type: str
     fragment = ...  # type: str
     query = ...  # type: multidict.MultiDict
@@ -24,10 +25,8 @@ class URL:
     parts = ...  # type: Tuple[str, ...]
     parent = ...  # type: URL
 
-    @overload
-    def __new__(cls, val: str='', *, strict: bool=...) -> URL: ...
-    @overload
-    def __new__(cls, val: URL) -> URL: ...
+    def __init__(self, val: Union[str, 'URL']=..., *, encoded: bool=...,
+                strict: bool=...) -> None: ...
 
     @classmethod
     def build(cls, *, scheme: str=..., user: str=..., password: str=...,
@@ -38,14 +37,14 @@ class URL:
     def __str__(self) -> str: ...
     def __repr__(self) -> str: ...
 
-    def __eq__(self, other) -> bool: ...
-    def __le__(self, other) -> bool: ...
-    def __lt__(self, other) -> bool: ...
-    def __ge__(self, other) -> bool: ...
-    def __gt__(self, other) -> bool: ...
+    def __eq__(self, other: Any) -> bool: ...
+    def __le__(self, other: Any) -> bool: ...
+    def __lt__(self, other: Any) -> bool: ...
+    def __ge__(self, other: Any) -> bool: ...
+    def __gt__(self, other: Any) -> bool: ...
     def __hash__(self) -> int: ...
 
-    def __truediv__(self, str) -> URL: ...
+    def __truediv__(self, str: str) -> URL: ...
 
     def is_absolute(self) -> bool: ...
     def is_default_port(self) -> bool: ...
@@ -58,7 +57,7 @@ class URL:
     def with_password(self, password: Optional[str]) -> URL: ...
     def with_host(self, host: str) -> URL: ...
     def with_port(self, port: Optional[int]) -> URL: ...
-    def with_path(self, path: str) -> URL: ...
+    def with_path(self, path: str, *, encoded: bool=...) -> URL: ...
 
     @overload
     def with_query(self, query: str) -> URL: ...
@@ -67,7 +66,7 @@ class URL:
     @overload
     def with_query(self, query: Sequence[Tuple[str, str]]) -> URL: ...
     @overload
-    def with_query(self, **kwargs) -> URL: ...
+    def with_query(self, **kwargs: str) -> URL: ...
 
     @overload
     def update_query(self, query: str) -> URL: ...
@@ -76,7 +75,7 @@ class URL:
     @overload
     def update_query(self, query: Sequence[Tuple[str, str]]) -> URL: ...
     @overload
-    def update_query(self, **kwargs) -> URL: ...
+    def update_query(self, **kwargs: str) -> URL: ...
 
     def with_fragment(self, fragment: Optional[str]) -> URL: ...
     def with_name(self, name: str) -> URL: ...
diff --git a/yarl/_quoting.c b/yarl/_quoting.c
index 307cd09..c0d6d8d 100644
--- a/yarl/_quoting.c
+++ b/yarl/_quoting.c
@@ -1,9 +1,13 @@
-/* Generated by Cython 0.25.2 */
+/* Generated by Cython 0.27 */
 
 /* BEGIN: Cython Metadata
 {
     "distutils": {
-        "depends": []
+        "depends": [],
+        "name": "yarl._quoting",
+        "sources": [
+            "yarl/_quoting.pyx"
+        ]
     },
     "module_name": "yarl._quoting"
 }
@@ -13,10 +17,11 @@ END: Cython Metadata */
 #include "Python.h"
 #ifndef Py_PYTHON_H
     #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
-    #error Cython requires Python 2.6+ or Python 3.2+.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+    #error Cython requires Python 2.6+ or Python 3.3+.
 #else
-#define CYTHON_ABI "0_25_2"
+#define CYTHON_ABI "0_27"
+#define CYTHON_FUTURE_DIVISION 1
 #include <stddef.h>
 #ifndef offsetof
   #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
@@ -38,8 +43,9 @@ END: Cython Metadata */
 #ifndef DL_EXPORT
   #define DL_EXPORT(t) t
 #endif
+#define __PYX_COMMA ,
 #ifndef HAVE_LONG_LONG
-  #if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
+  #if PY_VERSION_HEX >= 0x02070000
     #define HAVE_LONG_LONG
   #endif
 #endif
@@ -55,8 +61,14 @@ END: Cython Metadata */
   #define CYTHON_COMPILING_IN_CPYTHON 0
   #undef CYTHON_USE_TYPE_SLOTS
   #define CYTHON_USE_TYPE_SLOTS 0
-  #undef CYTHON_USE_ASYNC_SLOTS
-  #define CYTHON_USE_ASYNC_SLOTS 0
+  #undef CYTHON_USE_PYTYPE_LOOKUP
+  #define CYTHON_USE_PYTYPE_LOOKUP 0
+  #if PY_VERSION_HEX < 0x03050000
+    #undef CYTHON_USE_ASYNC_SLOTS
+    #define CYTHON_USE_ASYNC_SLOTS 0
+  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+    #define CYTHON_USE_ASYNC_SLOTS 1
+  #endif
   #undef CYTHON_USE_PYLIST_INTERNALS
   #define CYTHON_USE_PYLIST_INTERNALS 0
   #undef CYTHON_USE_UNICODE_INTERNALS
@@ -75,6 +87,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #elif defined(PYSTON_VERSION)
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 1
@@ -82,6 +98,8 @@ END: Cython Metadata */
   #ifndef CYTHON_USE_TYPE_SLOTS
     #define CYTHON_USE_TYPE_SLOTS 1
   #endif
+  #undef CYTHON_USE_PYTYPE_LOOKUP
+  #define CYTHON_USE_PYTYPE_LOOKUP 0
   #undef CYTHON_USE_ASYNC_SLOTS
   #define CYTHON_USE_ASYNC_SLOTS 0
   #undef CYTHON_USE_PYLIST_INTERNALS
@@ -106,6 +124,10 @@ END: Cython Metadata */
   #define CYTHON_FAST_THREAD_STATE 0
   #undef CYTHON_FAST_PYCALL
   #define CYTHON_FAST_PYCALL 0
+  #undef CYTHON_PEP489_MULTI_PHASE_INIT
+  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+  #undef CYTHON_USE_TP_FINALIZE
+  #define CYTHON_USE_TP_FINALIZE 0
 #else
   #define CYTHON_COMPILING_IN_PYPY 0
   #define CYTHON_COMPILING_IN_PYSTON 0
@@ -113,6 +135,12 @@ END: Cython Metadata */
   #ifndef CYTHON_USE_TYPE_SLOTS
     #define CYTHON_USE_TYPE_SLOTS 1
   #endif
+  #if PY_VERSION_HEX < 0x02070000
+    #undef CYTHON_USE_PYTYPE_LOOKUP
+    #define CYTHON_USE_PYTYPE_LOOKUP 0
+  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+    #define CYTHON_USE_PYTYPE_LOOKUP 1
+  #endif
   #if PY_MAJOR_VERSION < 3
     #undef CYTHON_USE_ASYNC_SLOTS
     #define CYTHON_USE_ASYNC_SLOTS 0
@@ -152,6 +180,12 @@ END: Cython Metadata */
   #ifndef CYTHON_FAST_PYCALL
     #define CYTHON_FAST_PYCALL 1
   #endif
+  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
+  #endif
+  #ifndef CYTHON_USE_TP_FINALIZE
+    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+  #endif
 #endif
 #if !defined(CYTHON_FAST_PYCCALL)
 #define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
@@ -190,19 +224,44 @@ END: Cython Metadata */
 #ifndef Py_TPFLAGS_HAVE_FINALIZE
   #define Py_TPFLAGS_HAVE_FINALIZE 0
 #endif
-#ifndef METH_FASTCALL
-  #define METH_FASTCALL 0x80
-  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
-                                              Py_ssize_t nargs, PyObject *kwnames);
+#if PY_VERSION_HEX < 0x030700A0 || !defined(METH_FASTCALL)
+  #ifndef METH_FASTCALL
+     #define METH_FASTCALL 0x80
+  #endif
+  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args, Py_ssize_t nargs);
+  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject **args,
+                                                          Py_ssize_t nargs, PyObject *kwnames);
 #else
   #define __Pyx_PyCFunctionFast _PyCFunctionFast
+  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
 #endif
 #if CYTHON_FAST_PYCCALL
 #define __Pyx_PyFastCFunction_Check(func)\
-    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
+    ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
 #else
 #define __Pyx_PyFastCFunction_Check(func) 0
 #endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+  #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03050200
+  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+  #define __Pyx_PyThreadState_Current PyThreadState_Get()
+#else
+  #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
+#endif
... 1623 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/yarl.git



More information about the Python-modules-commits mailing list