diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-07 05:52:13 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-07 05:52:13 +0000 |
commit | cbd66fbd83142d2be59a164b168c7c1fb8deb56e (patch) | |
tree | be0d315b170de31e88c8b8b30ba2255c3ddc878b | |
parent | b2077ff6f55e60f23cae4be1e9888875a7704963 (diff) |
automatic import of python-frozendict
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-frozendict.spec | 215 | ||||
-rw-r--r-- | sources | 2 |
3 files changed, 105 insertions, 113 deletions
@@ -1 +1,2 @@ /frozendict-2.3.5.tar.gz +/frozendict-2.3.6.tar.gz diff --git a/python-frozendict.spec b/python-frozendict.spec index ac18b13..5dd6bfd 100644 --- a/python-frozendict.spec +++ b/python-frozendict.spec @@ -1,11 +1,11 @@ %global _empty_manifest_terminate_build 0 Name: python-frozendict -Version: 2.3.5 +Version: 2.3.6 Release: 1 Summary: A simple immutable dictionary License: LGPL v3 URL: https://github.com/Marco-Sulla/python-frozendict -Source0: https://mirrors.nju.edu.cn/pypi/web/packages/41/44/1892c9b2a21f471ef2681559f9e57470795199330dad8eca734bce408434/frozendict-2.3.5.tar.gz +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/93/0b/d07e3ebdc3e31acff5a59a7e087c3f19bc456691dfd9afefd427168350d1/frozendict-2.3.6.tar.gz %description @@ -68,28 +68,13 @@ Same as `key(index)`, but it returns a tuple with (key, value) at the given inde ```python from frozendict import frozendict -fd = frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +fd = frozendict(Guzzanti = "Corrado", Hicks = "Bill") print(fd) # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) -print(fd["Guzzanti"]) -# Corrado - -fd["Brignano"] -# KeyError: 'Brignano' - -len(fd) -# 2 - -"Guzzanti" in fd -# True - -"Guzzanti" not in fd -# False - -"Brignano" in fd -# False +frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) hash(fd) # 5833699487320513741 @@ -98,17 +83,12 @@ fd_unhashable = frozendict({1: []}) hash(fd_unhashable) # TypeError: Not all values are hashable. +frozendict({frozendict(nested = 4, key = 2): 42}) +# frozendict({frozendict({'nested': 4, 'key': 2}): 42}) + fd | {1: 2} # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -fd5 = frozendict(fd) -id_fd5 = id(fd5) -fd5 |= {1: 2} -fd5 -# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -id(fd5) != id_fd5 -# True - fd.set(1, 2) # frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) @@ -133,6 +113,32 @@ fd.value(1) fd.item(-1) # (1, 2) +print(fd["Guzzanti"]) +# Corrado + +fd["Brignano"] +# KeyError: 'Brignano' + +len(fd) +# 2 + +"Guzzanti" in fd +# True + +"Guzzanti" not in fd +# False + +"Brignano" in fd +# False + +fd5 = frozendict(fd) +id_fd5 = id(fd5) +fd5 |= {1: 2} +fd5 +# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) +id(fd5) != id_fd5 +# True + fd2 = fd.copy() fd2 == fd # True @@ -159,9 +165,6 @@ fd_unpickled == fd frozendict(Guzzanti="Corrado", Hicks="Bill") # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'} -frozendict((("Guzzanti", "Corrado"), ("Hicks", "Bill"))) -# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) - fd.get("Guzzanti") # 'Corrado' @@ -194,11 +197,7 @@ You can build `frozendict` directly from the code, using python3 setup.py bdist_wheel ``` -The C Extension is not optional by default. You can build the pure py package using the `py` custom argument: - -``` -python3 setup.py py bdist_wheel -``` +The C Extension is optional by default from version 2.3.5. You can make it mandatory by passing the environment variable `CIBUILDWHEEL` with value `1` # Benchmarks @@ -361,8 +360,6 @@ Name: `class.fromkeys()`; Size: 1000; Keys: int; Type: frozendict; Time: 3 [1] Benchmarks done under Linux 64 bit, Python 3.10.2, using the C Extension. - - %package -n python3-frozendict Summary: A simple immutable dictionary Provides: python-frozendict @@ -432,28 +429,13 @@ Same as `key(index)`, but it returns a tuple with (key, value) at the given inde ```python from frozendict import frozendict -fd = frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +fd = frozendict(Guzzanti = "Corrado", Hicks = "Bill") print(fd) # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) -print(fd["Guzzanti"]) -# Corrado - -fd["Brignano"] -# KeyError: 'Brignano' - -len(fd) -# 2 - -"Guzzanti" in fd -# True - -"Guzzanti" not in fd -# False - -"Brignano" in fd -# False +frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) hash(fd) # 5833699487320513741 @@ -462,17 +444,12 @@ fd_unhashable = frozendict({1: []}) hash(fd_unhashable) # TypeError: Not all values are hashable. +frozendict({frozendict(nested = 4, key = 2): 42}) +# frozendict({frozendict({'nested': 4, 'key': 2}): 42}) + fd | {1: 2} # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -fd5 = frozendict(fd) -id_fd5 = id(fd5) -fd5 |= {1: 2} -fd5 -# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -id(fd5) != id_fd5 -# True - fd.set(1, 2) # frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) @@ -497,6 +474,32 @@ fd.value(1) fd.item(-1) # (1, 2) +print(fd["Guzzanti"]) +# Corrado + +fd["Brignano"] +# KeyError: 'Brignano' + +len(fd) +# 2 + +"Guzzanti" in fd +# True + +"Guzzanti" not in fd +# False + +"Brignano" in fd +# False + +fd5 = frozendict(fd) +id_fd5 = id(fd5) +fd5 |= {1: 2} +fd5 +# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) +id(fd5) != id_fd5 +# True + fd2 = fd.copy() fd2 == fd # True @@ -523,9 +526,6 @@ fd_unpickled == fd frozendict(Guzzanti="Corrado", Hicks="Bill") # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'} -frozendict((("Guzzanti", "Corrado"), ("Hicks", "Bill"))) -# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) - fd.get("Guzzanti") # 'Corrado' @@ -558,11 +558,7 @@ You can build `frozendict` directly from the code, using python3 setup.py bdist_wheel ``` -The C Extension is not optional by default. You can build the pure py package using the `py` custom argument: - -``` -python3 setup.py py bdist_wheel -``` +The C Extension is optional by default from version 2.3.5. You can make it mandatory by passing the environment variable `CIBUILDWHEEL` with value `1` # Benchmarks @@ -725,8 +721,6 @@ Name: `class.fromkeys()`; Size: 1000; Keys: int; Type: frozendict; Time: 3 [1] Benchmarks done under Linux 64 bit, Python 3.10.2, using the C Extension. - - %package help Summary: Development documents and examples for frozendict Provides: python3-frozendict-doc @@ -790,28 +784,13 @@ Same as `key(index)`, but it returns a tuple with (key, value) at the given inde ```python from frozendict import frozendict -fd = frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +fd = frozendict(Guzzanti = "Corrado", Hicks = "Bill") print(fd) # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) -print(fd["Guzzanti"]) -# Corrado - -fd["Brignano"] -# KeyError: 'Brignano' - -len(fd) -# 2 - -"Guzzanti" in fd -# True - -"Guzzanti" not in fd -# False - -"Brignano" in fd -# False +frozendict({"Guzzanti": "Corrado", "Hicks": "Bill"}) +# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) hash(fd) # 5833699487320513741 @@ -820,17 +799,12 @@ fd_unhashable = frozendict({1: []}) hash(fd_unhashable) # TypeError: Not all values are hashable. +frozendict({frozendict(nested = 4, key = 2): 42}) +# frozendict({frozendict({'nested': 4, 'key': 2}): 42}) + fd | {1: 2} # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -fd5 = frozendict(fd) -id_fd5 = id(fd5) -fd5 |= {1: 2} -fd5 -# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) -id(fd5) != id_fd5 -# True - fd.set(1, 2) # frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) @@ -855,6 +829,32 @@ fd.value(1) fd.item(-1) # (1, 2) +print(fd["Guzzanti"]) +# Corrado + +fd["Brignano"] +# KeyError: 'Brignano' + +len(fd) +# 2 + +"Guzzanti" in fd +# True + +"Guzzanti" not in fd +# False + +"Brignano" in fd +# False + +fd5 = frozendict(fd) +id_fd5 = id(fd5) +fd5 |= {1: 2} +fd5 +# frozendict.frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill', 1: 2}) +id(fd5) != id_fd5 +# True + fd2 = fd.copy() fd2 == fd # True @@ -881,9 +881,6 @@ fd_unpickled == fd frozendict(Guzzanti="Corrado", Hicks="Bill") # frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'} -frozendict((("Guzzanti", "Corrado"), ("Hicks", "Bill"))) -# frozendict({'Guzzanti': 'Corrado', 'Hicks': 'Bill'}) - fd.get("Guzzanti") # 'Corrado' @@ -916,11 +913,7 @@ You can build `frozendict` directly from the code, using python3 setup.py bdist_wheel ``` -The C Extension is not optional by default. You can build the pure py package using the `py` custom argument: - -``` -python3 setup.py py bdist_wheel -``` +The C Extension is optional by default from version 2.3.5. You can make it mandatory by passing the environment variable `CIBUILDWHEEL` with value `1` # Benchmarks @@ -1083,10 +1076,8 @@ Name: `class.fromkeys()`; Size: 1000; Keys: int; Type: frozendict; Time: 3 [1] Benchmarks done under Linux 64 bit, Python 3.10.2, using the C Extension. - - %prep -%autosetup -n frozendict-2.3.5 +%autosetup -n frozendict-2.3.6 %build %py3_build @@ -1126,5 +1117,5 @@ mv %{buildroot}/doclist.lst . %{_docdir}/* %changelog -* Thu Mar 09 2023 Python_Bot <Python_Bot@openeuler.org> - 2.3.5-1 +* Fri Apr 07 2023 Python_Bot <Python_Bot@openeuler.org> - 2.3.6-1 - Package Spec generated @@ -1 +1 @@ -a004aec8c3c3da305ea50a5d7572afe1 frozendict-2.3.5.tar.gz +d463dcfd7140e85569958a827f5e2428 frozendict-2.3.6.tar.gz |