Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-frozendict for
openSUSE:Factory checked in at 2022-08-01 21:32:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-frozendict (Old)
and /work/SRC/openSUSE:Factory/.python-frozendict.new.1533 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-frozendict"
Mon Aug 1 21:32:56 2022 rev:6 rq:991937 version:2.3.4
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-frozendict/python-frozendict.changes
2022-06-08 14:25:17.712530194 +0200
+++
/work/SRC/openSUSE:Factory/.python-frozendict.new.1533/python-frozendict.changes
2022-08-01 21:34:06.186294084 +0200
@@ -1,0 +2,9 @@
+Sun Jul 31 10:03:13 UTC 2022 - Marcus Rueckert <[email protected]>
+
+- Update to 2.3.4
+ - fixed various memory leaks
+ - Implemented a memory leak tracer
+ - Fixed memory leaks in repr() and in costruction of an empty
+ frozendict.
+
+-------------------------------------------------------------------
Old:
----
frozendict-2.3.2.tar.gz
New:
----
frozendict-2.3.4.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-frozendict.spec ++++++
--- /var/tmp/diff_new_pack.1GiUIV/_old 2022-08-01 21:34:06.706295576 +0200
+++ /var/tmp/diff_new_pack.1GiUIV/_new 2022-08-01 21:34:06.710295587 +0200
@@ -21,7 +21,7 @@
# Do not enable multibuild unless seriously necessary, it in
# combination with arch is a right mess!
Name: python-frozendict
-Version: 2.3.2
+Version: 2.3.4
Release: 0
Summary: An immutable dictionary
License: MIT
++++++ frozendict-2.3.2.tar.gz -> frozendict-2.3.4.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/frozendict-2.3.2/PKG-INFO
new/frozendict-2.3.4/PKG-INFO
--- old/frozendict-2.3.2/PKG-INFO 2022-04-20 22:14:02.069653700 +0200
+++ new/frozendict-2.3.4/PKG-INFO 2022-07-21 23:27:07.304688700 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: frozendict
-Version: 2.3.2
+Version: 2.3.4
Summary: A simple immutable dictionary
Home-page: https://github.com/Marco-Sulla/python-frozendict
Author: Marco Sulla
@@ -9,7 +9,6 @@
Project-URL: Bug Reports,
https://github.com/Marco-Sulla/python-frozendict/issues
Project-URL: Source, https://github.com/Marco-Sulla/python-frozendict
Keywords: immutable hashable picklable frozendict dict dictionary map Mapping
MappingProxyType developers stable utility
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3
(LGPLv3)
@@ -374,5 +373,3 @@
```
[1] Benchmarks done under Linux 64 bit, Python 3.10.2, using the C Extension.
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/frozendict-2.3.2/frozendict/VERSION
new/frozendict-2.3.4/frozendict/VERSION
--- old/frozendict-2.3.2/frozendict/VERSION 2022-04-20 22:13:46.000000000
+0200
+++ new/frozendict-2.3.4/frozendict/VERSION 2022-07-21 23:26:56.000000000
+0200
@@ -1 +1 @@
-2.3.2
\ No newline at end of file
+2.3.4
\ No newline at end of file
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_10/cpython_src/Objects/dictobject.c
new/frozendict-2.3.4/frozendict/src/3_10/cpython_src/Objects/dictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_10/cpython_src/Objects/dictobject.c
2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_10/cpython_src/Objects/dictobject.c
2022-07-21 23:26:56.000000000 +0200
@@ -1637,6 +1637,7 @@
PyTuple_SET_ITEM(args, 0, d1);
temp_dict = PyObject_Call((PyObject *) &PyDict_Type, args, NULL);
+ Py_DECREF(args);
}
if (temp_dict == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_10/frozendictobject.c
new/frozendict-2.3.4/frozendict/src/3_10/frozendictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_10/frozendictobject.c 2022-04-20
22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_10/frozendictobject.c 2022-07-21
23:26:56.000000000 +0200
@@ -279,8 +279,12 @@
}
PyTuple_SET_ITEM(args, 0, d);
+
+ PyObject* res = PyObject_Call((PyObject*) type, args, NULL);
+
+ Py_DECREF(args);
- return PyObject_Call((PyObject*) type, args, NULL);
+ return res;
}
/* Methods */
@@ -347,6 +351,8 @@
Py_ReprLeave(o);
+ Py_DECREF(dict_repr_res);
+
if (error) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
@@ -705,7 +711,11 @@
PyTypeObject* type = Py_TYPE(o);
- return PyObject_Call((PyObject *) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject *) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
PyObject* frozendict_deepcopy(PyObject* self, PyObject* memo) {
@@ -1417,12 +1427,19 @@
((PyDictObject*) empty_frozendict)->ma_keys = Py_EMPTY_KEYS;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
+ else {
+ Py_DECREF(mp);
+ }
Py_INCREF(empty_frozendict);
return empty_frozendict;
}
else {
+ if (mp->ma_keys != NULL) {
+ frozendict_keys_decref(mp->ma_keys, 0);
+ }
+
Py_INCREF(Py_EMPTY_KEYS);
mp->ma_keys = Py_EMPTY_KEYS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_6/cpython_src/Objects/dictobject.c
new/frozendict-2.3.4/frozendict/src/3_6/cpython_src/Objects/dictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_6/cpython_src/Objects/dictobject.c
2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_6/cpython_src/Objects/dictobject.c
2022-07-21 23:26:56.000000000 +0200
@@ -1824,6 +1824,7 @@
PyTuple_SET_ITEM(args, 0, d1);
temp_dict = PyObject_Call((PyObject *) &PyDict_Type, args, NULL);
+ Py_DECREF(args);
}
if (temp_dict == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_6/frozendictobject.c
new/frozendict-2.3.4/frozendict/src/3_6/frozendictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_6/frozendictobject.c 2022-04-20
22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_6/frozendictobject.c 2022-07-21
23:26:56.000000000 +0200
@@ -297,7 +297,11 @@
PyTuple_SET_ITEM(newargs, 0, d);
- return PyObject_Call(type, newargs, NULL);
+ PyObject* res = PyObject_Call((PyObject*) type, newargs, NULL);
+
+ Py_DECREF(newargs);
+
+ return res;
}
/* Methods */
@@ -364,6 +368,8 @@
Py_ReprLeave(o);
+ Py_DECREF(dict_repr_res);
+
if (error) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
@@ -717,7 +723,11 @@
PyTypeObject* type = Py_TYPE(o);
- return PyObject_Call((PyObject *) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject *) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
PyObject* frozendict_deepcopy(PyObject* self, PyObject* memo) {
@@ -1418,12 +1428,19 @@
((PyDictObject*) empty_frozendict)->ma_keys = Py_EMPTY_KEYS;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
+ else {
+ Py_DECREF(mp);
+ }
Py_INCREF(empty_frozendict);
return empty_frozendict;
}
else {
+ if (mp->ma_keys != NULL) {
+ frozendict_keys_decref(mp->ma_keys, 0);
+ }
+
Py_INCREF(Py_EMPTY_KEYS);
mp->ma_keys = Py_EMPTY_KEYS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_7/cpython_src/Objects/dictobject.c
new/frozendict-2.3.4/frozendict/src/3_7/cpython_src/Objects/dictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_7/cpython_src/Objects/dictobject.c
2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_7/cpython_src/Objects/dictobject.c
2022-07-21 23:26:56.000000000 +0200
@@ -1790,6 +1790,7 @@
PyTuple_SET_ITEM(args, 0, d1);
temp_dict = PyObject_Call((PyObject *) &PyDict_Type, args, NULL);
+ Py_DECREF(args);
}
if (temp_dict == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_7/frozendictobject.c
new/frozendict-2.3.4/frozendict/src/3_7/frozendictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_7/frozendictobject.c 2022-04-20
22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_7/frozendictobject.c 2022-07-21
23:26:56.000000000 +0200
@@ -286,7 +286,11 @@
PyTuple_SET_ITEM(args, 0, d);
- return PyObject_Call((PyObject*) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject*) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
/* Methods */
@@ -353,6 +357,8 @@
Py_ReprLeave(o);
+ Py_DECREF(dict_repr_res);
+
if (error) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
@@ -711,7 +717,11 @@
PyTypeObject* type = Py_TYPE(o);
- return PyObject_Call((PyObject *) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject *) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
PyObject* frozendict_deepcopy(PyObject* self, PyObject* memo) {
@@ -1434,12 +1444,19 @@
((PyDictObject*) empty_frozendict)->ma_keys = Py_EMPTY_KEYS;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
+ else {
+ Py_DECREF(mp);
+ }
Py_INCREF(empty_frozendict);
return empty_frozendict;
}
else {
+ if (mp->ma_keys != NULL) {
+ frozendict_keys_decref(mp->ma_keys, 0);
+ }
+
Py_INCREF(Py_EMPTY_KEYS);
mp->ma_keys = Py_EMPTY_KEYS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_8/cpython_src/Objects/dictobject.c
new/frozendict-2.3.4/frozendict/src/3_8/cpython_src/Objects/dictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_8/cpython_src/Objects/dictobject.c
2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_8/cpython_src/Objects/dictobject.c
2022-07-21 23:26:56.000000000 +0200
@@ -1662,6 +1662,7 @@
PyTuple_SET_ITEM(args, 0, d1);
temp_dict = PyObject_Call((PyObject *) &PyDict_Type, args, NULL);
+ Py_DECREF(args);
}
if (temp_dict == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_8/frozendictobject.c
new/frozendict-2.3.4/frozendict/src/3_8/frozendictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_8/frozendictobject.c 2022-04-20
22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_8/frozendictobject.c 2022-07-21
23:26:56.000000000 +0200
@@ -286,7 +286,11 @@
PyTuple_SET_ITEM(args, 0, d);
- return PyObject_Call((PyObject*) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject*) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
/* Methods */
@@ -353,6 +357,8 @@
Py_ReprLeave(o);
+ Py_DECREF(dict_repr_res);
+
if (error) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
@@ -711,7 +717,11 @@
PyTypeObject* type = Py_TYPE(o);
- return PyObject_Call((PyObject *) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject *) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
PyObject* frozendict_deepcopy(PyObject* self, PyObject* memo) {
@@ -1422,12 +1432,19 @@
((PyDictObject*) empty_frozendict)->ma_keys = Py_EMPTY_KEYS;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
+ else {
+ Py_DECREF(mp);
+ }
Py_INCREF(empty_frozendict);
return empty_frozendict;
}
else {
+ if (mp->ma_keys != NULL) {
+ frozendict_keys_decref(mp->ma_keys, 0);
+ }
+
Py_INCREF(Py_EMPTY_KEYS);
mp->ma_keys = Py_EMPTY_KEYS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_9/cpython_src/Objects/dictobject.c
new/frozendict-2.3.4/frozendict/src/3_9/cpython_src/Objects/dictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_9/cpython_src/Objects/dictobject.c
2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_9/cpython_src/Objects/dictobject.c
2022-07-21 23:26:56.000000000 +0200
@@ -1669,6 +1669,7 @@
PyTuple_SET_ITEM(args, 0, d1);
temp_dict = PyObject_Call((PyObject *) &PyDict_Type, args, NULL);
+ Py_DECREF(args);
}
if (temp_dict == NULL) {
return NULL;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/frozendict-2.3.2/frozendict/src/3_9/frozendictobject.c
new/frozendict-2.3.4/frozendict/src/3_9/frozendictobject.c
--- old/frozendict-2.3.2/frozendict/src/3_9/frozendictobject.c 2022-04-20
22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/frozendict/src/3_9/frozendictobject.c 2022-07-21
23:26:56.000000000 +0200
@@ -286,7 +286,11 @@
PyTuple_SET_ITEM(args, 0, d);
- return PyObject_Call((PyObject*) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject*) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
/* Methods */
@@ -353,6 +357,8 @@
Py_ReprLeave(o);
+ Py_DECREF(dict_repr_res);
+
if (error) {
_PyUnicodeWriter_Dealloc(&writer);
return NULL;
@@ -711,7 +717,11 @@
PyTypeObject* type = Py_TYPE(o);
- return PyObject_Call((PyObject *) type, args, NULL);
+ PyObject* res = PyObject_Call((PyObject *) type, args, NULL);
+
+ Py_DECREF(args);
+
+ return res;
}
PyObject* frozendict_deepcopy(PyObject* self, PyObject* memo) {
@@ -1423,12 +1433,19 @@
((PyDictObject*) empty_frozendict)->ma_keys = Py_EMPTY_KEYS;
mp->ma_version_tag = DICT_NEXT_VERSION();
}
+ else {
+ Py_DECREF(mp);
+ }
Py_INCREF(empty_frozendict);
return empty_frozendict;
}
else {
+ if (mp->ma_keys != NULL) {
+ frozendict_keys_decref(mp->ma_keys, 0);
+ }
+
Py_INCREF(Py_EMPTY_KEYS);
mp->ma_keys = Py_EMPTY_KEYS;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/frozendict-2.3.2/frozendict.egg-info/PKG-INFO
new/frozendict-2.3.4/frozendict.egg-info/PKG-INFO
--- old/frozendict-2.3.2/frozendict.egg-info/PKG-INFO 2022-04-20
22:14:01.000000000 +0200
+++ new/frozendict-2.3.4/frozendict.egg-info/PKG-INFO 2022-07-21
23:27:07.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: frozendict
-Version: 2.3.2
+Version: 2.3.4
Summary: A simple immutable dictionary
Home-page: https://github.com/Marco-Sulla/python-frozendict
Author: Marco Sulla
@@ -9,7 +9,6 @@
Project-URL: Bug Reports,
https://github.com/Marco-Sulla/python-frozendict/issues
Project-URL: Source, https://github.com/Marco-Sulla/python-frozendict
Keywords: immutable hashable picklable frozendict dict dictionary map Mapping
MappingProxyType developers stable utility
-Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3
(LGPLv3)
@@ -374,5 +373,3 @@
```
[1] Benchmarks done under Linux 64 bit, Python 3.10.2, using the C Extension.
-
-
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/frozendict-2.3.2/test/debug.py
new/frozendict-2.3.4/test/debug.py
--- old/frozendict-2.3.2/test/debug.py 2022-04-20 22:13:46.000000000 +0200
+++ new/frozendict-2.3.4/test/debug.py 2022-07-21 23:26:56.000000000 +0200
@@ -11,6 +11,9 @@
from pathlib import Path
from copy import copy, deepcopy
from collections.abc import MutableMapping
+import functools
+import tracemalloc
+import gc
def getUuid():
return str(uuid4())
@@ -45,14 +48,14 @@
def __len__(self):
return len(self._dict)
-def print_info(klass, iterations, stmt):
- if "\n" in stmt:
- sep = "\n"
- else:
- sep = " "
+def print_info(klass, iterations, func):
+ try:
+ name = func.__name__
+ except AttributeError:
+ name = func
print(
- f"Class = {klass.__name__} - Loops: {iterations} -
Evaluating:{sep}{stmt}",
+ f"Class = {klass.__name__} - Loops: {iterations} - Evaluating:
{name}",
flush=True
)
@@ -62,6 +65,33 @@
flush=True
)
+def trace(func):
+ @functools.wraps(func)
+ def inner():
+ tracemalloc.start()
+
+ snapshot1 = tracemalloc.take_snapshot().filter_traces(
+ (tracemalloc.Filter(True, __file__), )
+ )
+
+ for i in range(iterations):
+ func()
+
+ gc.collect()
+
+ snapshot2 = tracemalloc.take_snapshot().filter_traces(
+ (tracemalloc.Filter(True, __file__), )
+ )
+
+ top_stats = snapshot2.compare_to(snapshot1, 'lineno')
+ tracemalloc.stop()
+
+ for stat in top_stats:
+ if stat.count_diff > 3:
+ raise ValueError(f"count_diff: {stat.count_diff}")
+
+ return inner
+
argv = sys.argv
iterations = None
args_num = 1
@@ -99,159 +129,685 @@
dict_1_keys = tuple(dict_1.keys())
dict_1_keys_set = set(dict_1_keys)
-expressions = (
- 'frozendict_class(dict_1)',
- 'frozendict_class(dict_3)',
- 'frozendict_class()',
- 'frozendict_class({})',
- 'frozendict_class([])',
- 'frozendict_class({}, **{})',
- 'frozendict_class(**dict_1)',
- 'frozendict_class(dict_1, **dict_2)',
- 'frozendict_class(fd_1)',
- 'frozendict_class(generator_1)',
- 'frozendict_class(dict_hole)',
- 'fd_1.copy()',
- 'fd_1 == dict_1',
- 'fd_1 == fd_1',
- 'fd_1 != dict_hole',
- 'fd_1 != dict_2',
- 'fd_1 == dict_hole',
- 'fd_1 == dict_2',
- 'pickle.loads(pickle.dumps(fd_1))',
- 'frozendict_class(dict_1_items)',
- 'tuple(fd_1.keys())',
- 'tuple(fd_1.values())',
- 'tuple(fd_1.items())',
- 'frozendict_class.fromkeys(dict_1)',
- 'frozendict_class.fromkeys(dict_1, 1)',
- 'frozendict_class.fromkeys(dict_1_keys)',
- 'frozendict_class.fromkeys(dict_1_keys, 1)',
- 'frozendict_class.fromkeys(dict_1_keys_set)',
- 'frozendict_class.fromkeys(dict_1_keys_set, 1)',
- 'repr(fd_1)',
- 'fd_1 | dict_2',
- 'hash(fd_1)',
- 'frozendict_class() == frozendict_class()',
- 'tuple(reversed(fd_1))',
- 'tuple(reversed(fd_1.keys()))',
- 'tuple(reversed(fd_1.items()))',
- 'tuple(reversed(fd_1.values()))',
- 'iter(fd_1).__length_hint__()',
- 'len(fd_1)',
- 'len(fd_1.keys())',
- 'len(fd_1.items())',
- 'len(fd_1.values())',
- 'fd_1.keys().mapping == fd_1',
- 'fd_1.items().mapping == fd_1',
- 'fd_1.values().mapping == fd_1',
- 'fd_1[key_in]',
- 'fd_1.get(key_in)',
- 'fd_1.get(key_notin)',
- 'fd_1.get(key_notin, 1)',
- 'key_in in fd_1',
- 'key_notin in fd_1',
- 'fd_1.copy()',
- 'copy(fd_1)',
- 'deepcopy(fd_1)',
- 'deepcopy(fd_unashable)',
- 'fd_1.keys() == dict_1.keys()',
- 'fd_1.items() == dict_1.items()',
- 'key_notin in fd_1.keys()',
- '(key_notin, 0) in fd_1.items()',
- 'FMissing(fd_1)[0]',
- 'frozendict_class(Map(dict_1)) == dict_1',
- 'fd_1.keys().isdisjoint(dict_3)',
- 'fd_1.keys().isdisjoint(fd_1)',
- 'fd_1.items().isdisjoint(dict_3.items())',
- 'fd_1.items().isdisjoint(fd_1.items())',
- 'fd_unashable.keys() - fd_1.keys()',
- 'fd_1.items() - frozendict_class(dict_hole).items()',
- 'fd_1.keys() & frozendict_class(dict_hole).keys()',
- 'fd_1.items() & frozendict_class(dict_hole).items()',
- 'fd_1.keys() | frozendict_class(dict_2).keys()',
- 'fd_1.items() | frozendict_class(dict_2).items()',
- 'fd_1.keys() ^ frozendict_class(dict_hole).keys()',
- 'fd_1.items() ^ frozendict_class(dict_hole).items()',
- 'pickle.loads(pickle.dumps(iter(fd_1.keys())))',
- 'pickle.loads(pickle.dumps(iter(fd_1.items())))',
- 'pickle.loads(pickle.dumps(iter(fd_1.values())))',
- 'frozendict_class(dict_hole).keys() < fd_1.keys()',
- 'frozendict_class(dict_hole).keys() <= fd_1.keys()',
- 'frozendict_class(dict_hole).items() < fd_1.items()',
- 'fd_1.keys() > frozendict_class(dict_hole).keys()',
- 'fd_1.keys() >= frozendict_class(dict_hole).keys()',
- 'fd_1.items() > frozendict_class(dict_hole).items()',
- 'fd_1.items() >= frozendict_class(dict_hole).items()',
- "fd_1.set(key_in, 1000)",
- "fd_1.set(key_notin, 1000)",
- "fd_1.delete(key_in)",
- "fd_1.setdefault(key_in)",
- "fd_1.setdefault(key_notin)",
- "fd_1.setdefault(key_notin, 1000)",
- "fd_1.key()",
- "fd_1.key(0)",
- "fd_1.key(-1)",
- "fd_1.value()",
- "fd_1.value(0)",
- "fd_1.value(-1)",
- "fd_1.item()",
- "fd_1.item(0)",
- "fd_1.item(-1)",
-)
-
-codes = (
-"""
-for x in fd_1:
- pass
-""",
-"""
-for x in iter(fd_1):
- pass
-""",
-"""
-for x in fd_1.keys():
- pass
-""",
-"""
-for x in fd_1.values():
- pass
-""",
-"""
-for x in fd_1.items():
- pass
-""",
-"""
-try:
- hash(fd_unashable)
-except TypeError:
- pass
-""",
-"""
-try:
- fd_1[key_notin]
-except KeyError:
- pass
-""",
-"""
-try:
- fd_1.key(len(fd_1))
-except IndexError:
- pass
-""",
-"""
-try:
- fd_1.value(len(fd_1))
-except IndexError:
- pass
-""",
-"""
-try:
- fd_1.item(len(fd_1))
-except IndexError:
- pass
-""",
-)
+functions = []
+
+@trace
+def func_1():
+ frozendict_class(dict_1)
+
+functions.append(func_1)
+
+@trace
+def func_2():
+ frozendict_class(dict_unashable)
+
+functions.append(func_2)
+
+@trace
+def func_3():
+ frozendict_class(dict_3)
+
+functions.append(func_3)
+
+@trace
+def func_4():
+ frozendict_class()
+
+functions.append(func_4)
+
+@trace
+def func_5():
+ frozendict_class({})
+
+functions.append(func_5)
+
+@trace
+def func_7():
+ frozendict_class([])
+
+functions.append(func_7)
+
+@trace
+def func_8():
+ frozendict_class({}, **{})
+
+functions.append(func_8)
+
+@trace
+def func_9():
+ frozendict_class(**dict_1)
+
+functions.append(func_9)
+
+@trace
+def func_10():
+ frozendict_class(dict_1, **dict_2)
+
+functions.append(func_10)
+
+@trace
+def func_11():
+ frozendict_class(fd_1)
+
+functions.append(func_11)
+
+@trace
+def func_12():
+ generator_1 = ((key, val) for key, val in dict_1.items())
+ frozendict_class(generator_1)
+
+functions.append(func_12)
+
+@trace
+def func_13():
+ frozendict_class(dict_hole)
+
+functions.append(func_13)
+
+@trace
+def func_14():
+ fd_1.copy()
+
+functions.append(func_14)
+
+@trace
+def func_15():
+ fd_1 == dict_1
+
+functions.append(func_15)
+
+@trace
+def func_16():
+ fd_1 == fd_1
+
+functions.append(func_16)
+
+@trace
+def func_17():
+ fd_1 != dict_hole
+
+functions.append(func_17)
+
+@trace
+def func_18():
+ fd_1 != dict_2
+
+functions.append(func_18)
+
+@trace
+def func_19():
+ fd_1 == dict_hole
+
+functions.append(func_19)
+
+@trace
+def func_20():
+ fd_1 == dict_2
+
+functions.append(func_20)
+
+# @trace
+def func_21():
+ pickle.loads(pickle.dumps(fd_1))
+
+functions.append(func_21)
+
+@trace
+def func_22():
+ frozendict_class(dict_1_items)
+
+functions.append(func_22)
+
+@trace
+def func_23():
+ tuple(fd_1.keys())
+
+functions.append(func_23)
+
+@trace
+def func_24():
+ tuple(fd_1.values())
+
+functions.append(func_24)
+
+@trace
+def func_25():
+ tuple(fd_1.items())
+
+functions.append(func_25)
+
+@trace
+def func_26():
+ frozendict_class.fromkeys(dict_1)
+
+functions.append(func_26)
+
+@trace
+def func_27():
+ frozendict_class.fromkeys(dict_1, 1)
+
+functions.append(func_27)
+
+@trace
+def func_28():
+ frozendict_class.fromkeys(dict_1_keys)
+
+functions.append(func_28)
+
+@trace
+def func_29():
+ frozendict_class.fromkeys(dict_1_keys, 1)
+
+functions.append(func_29)
+
+@trace
+def func_30():
+ frozendict_class.fromkeys(dict_1_keys_set)
+
+functions.append(func_30)
+
+@trace
+def func_31():
+ frozendict_class.fromkeys(dict_1_keys_set, 1)
+
+functions.append(func_31)
+
+@trace
+def func_32():
+ repr(fd_1)
+
+functions.append(func_32)
+
+@trace
+def func_33():
+ fd_1 | dict_2
+
+functions.append(func_33)
+
+@trace
+def func_34():
+ hash(fd_1)
+
+functions.append(func_34)
+
+@trace
+def func_35():
+ frozendict_class() == frozendict_class()
+
+functions.append(func_35)
+
+@trace
+def func_36():
+ tuple(reversed(fd_1))
+
+functions.append(func_36)
+
+@trace
+def func_37():
+ tuple(reversed(fd_1.keys()))
+
+functions.append(func_37)
+
+@trace
+def func_38():
+ tuple(reversed(fd_1.items()))
+
+functions.append(func_38)
+
+@trace
+def func_39():
+ tuple(reversed(fd_1.values()))
+
+functions.append(func_39)
+
+@trace
+def func_40():
+ iter(fd_1).__length_hint__()
+
+
+functions.append(func_40)
+
+@trace
+def func_41():
+ len(fd_1)
+
+functions.append(func_41)
+
+@trace
+def func_42():
+ len(fd_1.keys())
+
+functions.append(func_42)
+
+@trace
+def func_43():
+ len(fd_1.items())
+
+functions.append(func_43)
+
+@trace
+def func_44():
+ len(fd_1.values())
+
+functions.append(func_44)
+
+@trace
+def func_45():
+ fd_1.keys().mapping == fd_1
+
+functions.append(func_45)
+
+@trace
+def func_46():
+ fd_1.items().mapping == fd_1
+
+functions.append(func_46)
+
+@trace
+def func_47():
+ fd_1.values().mapping == fd_1
+
+functions.append(func_47)
+
+@trace
+def func_48():
+ fd_1[key_in]
+
+functions.append(func_48)
+
+@trace
+def func_49():
+ fd_1.get(key_in)
+
+functions.append(func_49)
+
+@trace
+def func_50():
+ fd_1.get(key_notin)
+
+functions.append(func_50)
+
+@trace
+def func_51():
+ fd_1.get(key_notin, 1)
+
+functions.append(func_51)
+
+@trace
+def func_52():
+ key_in in fd_1
+
+functions.append(func_52)
+
+@trace
+def func_53():
+ key_notin in fd_1
+
+functions.append(func_53)
+
+@trace
+def func_54():
+ fd_1.copy()
+
+functions.append(func_54)
+
+@trace
+def func_55():
+ copy(fd_1)
+
+functions.append(func_55)
+
+@trace
+def func_56():
+ deepcopy(fd_1)
+
+functions.append(func_56)
+
+@trace
+def func_57():
+ deepcopy(fd_unashable)
+
+functions.append(func_57)
+
+@trace
+def func_58():
+ fd_1.keys() == dict_1.keys()
+
+functions.append(func_58)
+
+@trace
+def func_59():
+ fd_1.items() == dict_1.items()
+
+functions.append(func_59)
+
+@trace
+def func_60():
+ key_notin in fd_1.keys()
+
+functions.append(func_60)
+
+@trace
+def func_61():
+ (key_notin, 0) in fd_1.items()
+
+functions.append(func_61)
+
+@trace
+def func_62():
+ FMissing(fd_1)[0]
+
+functions.append(func_62)
+
+@trace
+def func_63():
+ mp = Map(dict_1)
+ frozendict_class(mp) == dict_1
+
+functions.append(func_63)
+
+@trace
+def func_64():
+ fd_1.keys().isdisjoint(dict_3)
+
+functions.append(func_64)
+
+@trace
+def func_65():
+ fd_1.keys().isdisjoint(fd_1)
+
+functions.append(func_65)
+
+@trace
+def func_66():
+ fd_1.items().isdisjoint(dict_3.items())
+
+functions.append(func_66)
+
+@trace
+def func_67():
+ fd_1.items().isdisjoint(fd_1.items())
+
+functions.append(func_67)
+
+@trace
+def func_68():
+ fd_unashable.keys() - fd_1.keys()
+
+functions.append(func_68)
+
+@trace
+def func_69():
+ fd_1.items() - frozendict_class(dict_hole).items()
+
+functions.append(func_69)
+
+@trace
+def func_70():
+ fd_1.keys() & frozendict_class(dict_hole).keys()
+
+functions.append(func_70)
+
+@trace
+def func_71():
+ fd_1.items() & frozendict_class(dict_hole).items()
+
+functions.append(func_71)
+
+@trace
+def func_72():
+ fd_1.keys() | frozendict_class(dict_2).keys()
+
+functions.append(func_72)
+
+@trace
+def func_73():
+ fd_1.items() | frozendict_class(dict_2).items()
+
+functions.append(func_73)
+
+@trace
+def func_74():
+ fd_1.keys() ^ frozendict_class(dict_hole).keys()
+
+functions.append(func_74)
+
+@trace
+def func_75():
+ fd_1.items() ^ frozendict_class(dict_hole).items()
+
+functions.append(func_75)
+
+# @trace
+def func_76():
+ pickle.loads(pickle.dumps(iter(fd_1.keys())))
+
+functions.append(func_76)
+
+# @trace
+def func_77():
+ pickle.loads(pickle.dumps(iter(fd_1.items())))
+
+functions.append(func_77)
+
+# @trace
+def func_78():
+ pickle.loads(pickle.dumps(iter(fd_1.values())))
+
+functions.append(func_78)
+
+@trace
+def func_79():
+ frozendict_class(dict_hole).keys() < fd_1.keys()
+
+functions.append(func_79)
+
+@trace
+def func_80():
+ frozendict_class(dict_hole).keys() <= fd_1.keys()
+
+functions.append(func_80)
+
+@trace
+def func_81():
+ frozendict_class(dict_hole).items() < fd_1.items()
+
+functions.append(func_81)
+
+@trace
+def func_82():
+ fd_1.keys() > frozendict_class(dict_hole).keys()
+
+functions.append(func_82)
+
+@trace
+def func_83():
+ fd_1.keys() >= frozendict_class(dict_hole).keys()
+
+functions.append(func_83)
+
+@trace
+def func_84():
+ fd_1.items() > frozendict_class(dict_hole).items()
+
+functions.append(func_84)
+
+@trace
+def func_85():
+ fd_1.items() >= frozendict_class(dict_hole).items()
+
+functions.append(func_85)
+
+@trace
+def func_86():
+ fd_1.set(key_in, 1000)
+
+functions.append(func_86)
+
+@trace
+def func_87():
+ fd_1.set(key_notin, 1000)
+
+functions.append(func_87)
+
+@trace
+def func_88():
+ fd_1.delete(key_in)
+
+functions.append(func_88)
+
+@trace
+def func_89():
+ fd_1.setdefault(key_in)
+
+functions.append(func_89)
+
+@trace
+def func_90():
+ fd_1.setdefault(key_notin)
+
+functions.append(func_90)
+
+@trace
+def func_91():
+ fd_1.setdefault(key_notin, 1000)
+
+functions.append(func_91)
+
+@trace
+def func_92():
+ fd_1.key()
+
+functions.append(func_92)
+
+@trace
+def func_93():
+ fd_1.key(0)
+
+functions.append(func_93)
+
+@trace
+def func_94():
+ fd_1.key(-1)
+
+functions.append(func_94)
+
+@trace
+def func_95():
+ fd_1.value()
+
+functions.append(func_95)
+
+@trace
+def func_96():
+ fd_1.value(0)
+
+functions.append(func_96)
+
+@trace
+def func_97():
+ fd_1.value(-1)
+
+functions.append(func_97)
+
+@trace
+def func_98():
+ fd_1.item()
+
+functions.append(func_98)
+
+@trace
+def func_99():
+ fd_1.item(0)
+
+functions.append(func_99)
+
+@trace
+def func_100():
+ fd_1.item(-1)
+
+functions.append(func_100)
+
+@trace
+def func_101():
+ for x in fd_1:
+ pass
+
+functions.append(func_101)
+
+@trace
+def func_102():
+ for x in iter(fd_1):
+ pass
+
+functions.append(func_102)
+
+@trace
+def func_103():
+ for x in fd_1.keys():
+ pass
+
+functions.append(func_103)
+
+@trace
+def func_104():
+ for x in fd_1.values():
+ pass
+
+functions.append(func_104)
+
+@trace
+def func_105():
+ for x in fd_1.items():
+ pass
+
+functions.append(func_105)
+
+@trace
+def func_106():
+ try:
+ hash(fd_unashable)
+ except TypeError:
+ pass
+
+functions.append(func_106)
+
+@trace
+def func_107():
+ try:
+ fd_1[key_notin]
+ except KeyError:
+ pass
+
+functions.append(func_107)
+
+@trace
+def func_108():
+ try:
+ fd_1.key(len(fd_1))
+ except IndexError:
+ pass
+
+
+functions.append(func_108)
+
+@trace
+def func_109():
+ try:
+ fd_1.value(len(fd_1))
+ except IndexError:
+ pass
+
+functions.append(func_109)
+
+@trace
+def func_110():
+ try:
+ fd_1.item(len(fd_1))
+ except IndexError:
+ pass
+
+functions.append(func_110)
print_sep()
@@ -273,18 +829,9 @@
fd_unashable = frozendict_class(dict_unashable)
print_sep()
- for expression in expressions:
- print_info(frozendict_class, iterations, expression)
-
- for j in range(iterations):
- eval(expression)
-
- print_sep()
-
- for code in codes:
- print_info(frozendict_class, iterations, code)
+ for function in functions:
+ print_info(frozendict_class, iterations, function)
- for j in range(iterations):
- exec(code)
+ function()
print_sep()