memory-graph 0.3.72__tar.gz → 0.3.73__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. {memory_graph-0.3.72 → memory_graph-0.3.73}/PKG-INFO +1 -1
  2. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/__init__.py +1 -1
  3. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/utils.py +22 -11
  4. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph.egg-info/PKG-INFO +1 -1
  5. {memory_graph-0.3.72 → memory_graph-0.3.73}/pyproject.toml +1 -1
  6. {memory_graph-0.3.72 → memory_graph-0.3.73}/LICENSE.txt +0 -0
  7. {memory_graph-0.3.72 → memory_graph-0.3.73}/README.md +0 -0
  8. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/call_stack.py +0 -0
  9. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/config.py +0 -0
  10. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/config_default.py +0 -0
  11. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/config_helpers.py +0 -0
  12. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/extension_numpy.py +0 -0
  13. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/extension_pandas.py +0 -0
  14. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/extension_torch.py +0 -0
  15. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/html_table.py +0 -0
  16. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/list_view.py +0 -0
  17. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/memory_to_nodes.py +0 -0
  18. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/node_base.py +0 -0
  19. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/node_key_value.py +0 -0
  20. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/node_leaf.py +0 -0
  21. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/node_linear.py +0 -0
  22. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/node_table.py +0 -0
  23. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/sequence.py +0 -0
  24. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/slicer.py +0 -0
  25. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/slices.py +0 -0
  26. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/slices_iterator.py +0 -0
  27. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/slices_table_iterator.py +0 -0
  28. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test.py +0 -0
  29. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_max_graph_depth.py +0 -0
  30. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_memory_graph.py +0 -0
  31. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_memory_to_nodes.py +0 -0
  32. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_sequence.py +0 -0
  33. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_slicer.py +0 -0
  34. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_slices.py +0 -0
  35. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph/test_slices_iterator.py +0 -0
  36. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph.egg-info/SOURCES.txt +0 -0
  37. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph.egg-info/dependency_links.txt +0 -0
  38. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph.egg-info/requires.txt +0 -0
  39. {memory_graph-0.3.72 → memory_graph-0.3.73}/memory_graph.egg-info/top_level.txt +0 -0
  40. {memory_graph-0.3.72 → memory_graph-0.3.73}/setup.cfg +0 -0
  41. {memory_graph-0.3.72 → memory_graph-0.3.73}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memory_graph
3
- Version: 0.3.72
3
+ Version: 0.3.73
4
4
  Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
5
5
  Author-email: Bas Terwijn <bterwijn@gmail.com>
6
6
  License-Expression: BSD-2-Clause
@@ -2,7 +2,7 @@
2
2
  # Copyright (c) 2023, Bas Terwijn.
3
3
  # SPDX-License-Identifier: BSD-2-Clause
4
4
 
5
- __version__ = "0.3.72"
5
+ __version__ = "0.3.73"
6
6
  __author__ = 'Bas Terwijn'
7
7
 
8
8
  import memory_graph.memory_to_nodes as memory_to_nodes
@@ -4,6 +4,7 @@
4
4
 
5
5
  import math
6
6
  import types
7
+ import functools
7
8
 
8
9
  def has_dict_attributes(value):
9
10
  """ Returns 'True' if 'value' has a '__dict__' attribute. """
@@ -13,33 +14,43 @@ def get_dict_attributes(value):
13
14
  """ Returns the items of the '__dict__' attribute of 'value'."""
14
15
  return getattr(value,"__dict__")
15
16
 
16
- def is_function(obj):
17
- if isinstance(obj, types.FunctionType) or isinstance(obj, types.MethodType):
17
+ def is_not_state(obj):
18
+ if isinstance(obj, (types.FunctionType, types.MethodType,
19
+ types.BuiltinFunctionType, types.BuiltinMethodType,
20
+ classmethod, staticmethod,
21
+ property, functools.partialmethod)):
18
22
  return True
19
- return type(obj).__name__ in {'method_descriptor', 'builtin_function_or_method', 'getset_descriptor', 'classmethod_descriptor'}
23
+ return type(obj).__name__ in {
24
+ 'method_descriptor',
25
+ 'builtin_function_or_method',
26
+ 'getset_descriptor',
27
+ 'classmethod_descriptor',
28
+ 'wrapper_descriptor',
29
+ 'member_descriptor',
30
+ 'method-wrapper',
31
+ }
20
32
 
21
33
  def filter_dict(dictionary):
22
34
  """ Filters out the unwanted dict attributes. """
23
- if '__name__' in dictionary: # filter stack frames in global scope
24
- return [
35
+ if '__name__' in dictionary:
36
+ return [ # filter classes and modules, no non-state allowed as values
25
37
  (k,v) for k, v in dictionary.items() if
26
38
  not (type(k) is str and k.startswith('__')) and
27
39
  not isinstance(v,types.ModuleType) and
28
- not is_function(v)
40
+ not is_not_state(v)
29
41
  ]
30
- return [
42
+ return [ # filter dictionaries, non-state allowed as values
31
43
  (k,v) for k, v in dictionary.items() if
32
44
  not (type(k) is str and k.startswith('__'))
33
45
  ]
34
46
 
35
47
  def filter_type_attributes(tuples):
36
48
  """ Filters out the unwanted type attributes (class/static methods). """
37
- return [
49
+ return [ # filter type objects, no non-state allowed as values
38
50
  (k,v) for k, v in tuples if
39
51
  not (type(k) is str and k.startswith('__')) and
40
- not type(v) in {classmethod, staticmethod} and
41
- not callable(v)
42
- ]
52
+ not is_not_state(v)
53
+ ]
43
54
 
44
55
  def make_sliceable(data):
45
56
  """ Returns a sliceble version of data, convert to list if not yet sliceble. """
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: memory_graph
3
- Version: 0.3.72
3
+ Version: 0.3.73
4
4
  Summary: Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy.
5
5
  Author-email: Bas Terwijn <bterwijn@gmail.com>
6
6
  License-Expression: BSD-2-Clause
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "memory_graph"
7
- version = "0.3.72"
7
+ version = "0.3.73"
8
8
  description = "Teaching tool and debugging aid in context of references, mutable data types, and shallow and deep copy."
9
9
  authors = [
10
10
  {name = "Bas Terwijn", email = "bterwijn@gmail.com"}
File without changes
File without changes
File without changes
File without changes