memorymanagement 1.1.4__py3-none-any.whl → 1.2.0__py3-none-any.whl
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.
- memorymanagement/cleaning/__init__.py +1 -1
- memorymanagement/cleaning/core.py +17 -12
- memorymanagement/pointers/__init__.py +3 -2
- memorymanagement/pointers/core.py +152 -68
- memorymanagement/pointers/decorators.py +21 -2
- {memorymanagement-1.1.4.dist-info → memorymanagement-1.2.0.dist-info}/METADATA +3 -7
- memorymanagement-1.2.0.dist-info/RECORD +11 -0
- {memorymanagement-1.1.4.dist-info → memorymanagement-1.2.0.dist-info}/WHEEL +1 -1
- memorymanagement-1.1.4.dist-info/RECORD +0 -11
- {memorymanagement-1.1.4.dist-info → memorymanagement-1.2.0.dist-info}/licenses/LICENSE +0 -0
- {memorymanagement-1.1.4.dist-info → memorymanagement-1.2.0.dist-info}/top_level.txt +0 -0
|
@@ -6,22 +6,20 @@ class Cleaner:
|
|
|
6
6
|
"""
|
|
7
7
|
Class for references management. It keeps track of the names of the global variables to be deleted and deletes them when ordered.
|
|
8
8
|
|
|
9
|
-
The cleaning process only deletes the flagged references to objects, but doesn't directly force the garbage collector to destroy the objects they are pointing to
|
|
10
|
-
|
|
9
|
+
The cleaning process only deletes the flagged references to objects, but doesn't directly force the garbage collector to destroy the objects they are pointing to.\n
|
|
11
10
|
---
|
|
12
11
|
## WARNING
|
|
13
12
|
THERE CAN ONLY BE **ONE** CLEANER OBJECT.\n
|
|
14
|
-
Initializing a new one will delete all global references to the previous one
|
|
15
|
-
|
|
13
|
+
Initializing a new one will delete all global references to the previous one.\n
|
|
16
14
|
---
|
|
17
15
|
Attributes:
|
|
18
16
|
_not_delete (`list[str]`, Hidden): List of variables to never delete from memory. These cannot be included in the process even if ordered so.\n
|
|
19
17
|
These mainly are variables needed for the system to work and imports.
|
|
20
18
|
_excluded (`list[str]`, Hidden): List of variables excluded from the memory cleaning that can be included again if desired.
|
|
21
19
|
_flagged (`list[str]`, Hidden): List of variables to erase from memory. Variables can be put in and/or taken out through methods.
|
|
20
|
+
_name (`str`, Hidden): Name of the variable referencing the `Cleaner` object. Only for internal purposes.
|
|
22
21
|
---
|
|
23
|
-
|
|
24
|
-
## Methods
|
|
22
|
+
\n## Methods
|
|
25
23
|
:update: *`MethodType`*
|
|
26
24
|
Updates the list of variables to erase from memory including all the new variables global variables not manually excluded.\n
|
|
27
25
|
It also allows to incorporate previously excluded variables.
|
|
@@ -32,8 +30,7 @@ class Cleaner:
|
|
|
32
30
|
:clean: *`MethodType`*
|
|
33
31
|
Erases all the flagged references from memory.
|
|
34
32
|
---
|
|
35
|
-
|
|
36
|
-
## Properties
|
|
33
|
+
\n## Properties
|
|
37
34
|
:not_delete: *`MethodType`*, *Getter*
|
|
38
35
|
Returns the list of variables that shouldn't be deleted and can't be included in the cleaning process.
|
|
39
36
|
:excluded: *`MethodType`*, *Getter*
|
|
@@ -45,8 +42,7 @@ class Cleaner:
|
|
|
45
42
|
def __init__(self,not_delete:list[str]|None=None,excluded:list[str]=[],flagged:list[str]=[]):
|
|
46
43
|
"""
|
|
47
44
|
Initializes the class instance.\n
|
|
48
|
-
It is recommended to initialize the instance right after all global imports at the beggining of the program so no argument is needed
|
|
49
|
-
|
|
45
|
+
It is recommended to initialize the instance right after all global imports at the beggining of the program so no argument is needed.\n
|
|
50
46
|
---
|
|
51
47
|
Arguments:
|
|
52
48
|
not_delete (`list[str]`, Optional): List of variables to never be deleted. It takes the list of global variables of the main module by default.
|
|
@@ -61,6 +57,7 @@ class Cleaner:
|
|
|
61
57
|
self._not_delete=not_delete.copy()
|
|
62
58
|
self._excluded=excluded.copy()
|
|
63
59
|
self._flagged=flagged.copy()
|
|
60
|
+
self._name=None
|
|
64
61
|
def update(self,exclude:str|list[str]|tuple[str]|None=None,include:str|list[str]|tuple[str]|None=None):
|
|
65
62
|
"""
|
|
66
63
|
Flags all the new global variables' references that were not manually excluded here or before. You can also include previously excluded references.
|
|
@@ -85,8 +82,16 @@ class Cleaner:
|
|
|
85
82
|
self._flagged=[var for var in list(vars(modules["__main__"]))if var not in self.not_delete and var not in self.excluded]
|
|
86
83
|
@property
|
|
87
84
|
def not_delete(self):
|
|
88
|
-
if
|
|
89
|
-
|
|
85
|
+
if not self._name or vars(modules["__main__"])[self._name] is not self:
|
|
86
|
+
for key,value in vars(modules["__main__"]).items():
|
|
87
|
+
if value is self:
|
|
88
|
+
self._name=key
|
|
89
|
+
self._not_delete.append(self._name)
|
|
90
|
+
break
|
|
91
|
+
if not self._name:
|
|
92
|
+
raise ReferenceError("'Cleaner' object is not referenced")
|
|
93
|
+
elif self._name not in self._not_delete:
|
|
94
|
+
self._not_delete.append(self._name)
|
|
90
95
|
return self._not_delete
|
|
91
96
|
@property
|
|
92
97
|
def excluded(self):
|
|
@@ -5,11 +5,12 @@ A safe implementation of pointers written in pure Python.
|
|
|
5
5
|
It is safe beacause it doesn't imitate the internal behaviour of C pointers because it could break the memory.
|
|
6
6
|
It only replicates the visible effects and behaviour of C pointers.
|
|
7
7
|
## Class `Pointer`
|
|
8
|
-
This is the core of the module. The class `Pointer` points to a specific reference,
|
|
8
|
+
This is the core of the module. The class `Pointer` points to a specific reference (not object in memory),
|
|
9
9
|
which will be syncrhonized with the pointer's value since the moment of the pointer's creation.
|
|
10
10
|
## Decorator `pointerize`
|
|
11
11
|
This decorator makes any function able to receive `Pointer` objects instead of the originally expected.
|
|
12
12
|
"""
|
|
13
13
|
# Import from modules
|
|
14
14
|
from .core import Pointer # Class "Pointer"
|
|
15
|
-
from .decorators import pointerize # Decorator "pointerize"
|
|
15
|
+
from .decorators import pointerize # Decorator "pointerize"
|
|
16
|
+
__all__=["Pointer","pointerize"]
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
#* LEGEND
|
|
3
3
|
#*-------------------------------------------------------------------------------------------------------------------------------
|
|
4
4
|
#! Missing
|
|
5
|
+
#& Missing unimportant
|
|
5
6
|
#? Question
|
|
6
7
|
#* Section
|
|
7
8
|
#^ Important
|
|
@@ -18,10 +19,13 @@ from typing import TypeVar,Generic
|
|
|
18
19
|
from sys import modules
|
|
19
20
|
# Import "currentframe" from "inspect" package
|
|
20
21
|
from inspect import currentframe
|
|
22
|
+
# Define type with TypeVar
|
|
23
|
+
PT=TypeVar("PT")
|
|
21
24
|
|
|
22
25
|
#* MAIN CLASS
|
|
23
26
|
# Define the class "Pointer" with generic type
|
|
24
|
-
class Pointer(Generic[
|
|
27
|
+
class Pointer(Generic[PT]):
|
|
28
|
+
#& Missing code comments
|
|
25
29
|
"""
|
|
26
30
|
Implements pointers in Python for both mutable (though unneded) and non-mutable objects.
|
|
27
31
|
These pointers are completely safe and do not work internally as C's pointers, they are just an imitation of their behaviour.
|
|
@@ -31,10 +35,10 @@ class Pointer(Generic[TypeVar("Any")]):
|
|
|
31
35
|
|
|
32
36
|
Non-mutable objects still change their memory adresses when re-referenced but the reference and the value stored in the pointer are forced to share memory adress.
|
|
33
37
|
|
|
34
|
-
Value and memory adress updates are not made in real-time, but the
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
+
Value and memory adress updates are not made in real-time, but the properties update the non-coincident values:
|
|
39
|
+
* **Getter**: it updates its own value to the variable's one (if variable was given instead of literal).
|
|
40
|
+
* **Setter**: it updates the value of the variable to its own (if variable was given instead of literal).
|
|
41
|
+
* **Deleter**: it also deletes the original variable (if variable was given instead of literal).
|
|
38
42
|
---
|
|
39
43
|
Attributes:
|
|
40
44
|
value (`Any`, Hidden): Object to point to.
|
|
@@ -42,33 +46,36 @@ class Pointer(Generic[TypeVar("Any")]):
|
|
|
42
46
|
name (`str`, Hidden): Name of the global variable to which the pointer is pointing.
|
|
43
47
|
Could require an input from the user to introduce the name of the variable if more than one is found.
|
|
44
48
|
vars_dict (`dict[str,Any]`, Hidden): Dictionary of variables.
|
|
45
|
-
`vars(modules["__main__"])` if pointing to a global variable and `inspect.currentframe().f_back.f_locals` if pointing to a local variable
|
|
49
|
+
`vars(modules["__main__"])` if pointing to a global variable and `inspect.currentframe().f_back.f_locals` if pointing to a local variable.\n
|
|
46
50
|
---
|
|
47
|
-
|
|
48
51
|
## Methods
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
All three methods are part of the same property.
|
|
52
|
+
* `point_to`: Changes the variable or attribute the pointer is pointed to.
|
|
53
|
+
* `switch_ref`: Allows to switch between the references pointing to the same value.
|
|
54
|
+
* `print_refs`: Prints all the references pointing to the value.
|
|
53
55
|
---
|
|
54
|
-
## Properties
|
|
55
|
-
|
|
56
|
-
Points to `value` (or `value.attr`). Called through `<instance>.value`. All three possible objects (getter, setter and deleter) have been declared.
|
|
57
|
-
|
|
56
|
+
## Properties\n
|
|
57
|
+
:value: *`MethodType`*\n
|
|
58
|
+
Points to `value` (or `value.attr`). Called through `<instance@Pointer>.value`. All three possible objects (getter, setter and deleter) have been declared.
|
|
59
|
+
:reference: *`MethodType`*\n
|
|
60
|
+
Pointed reference. Called through `<instance@Pointer>.reference`. **Only getter** defined.
|
|
61
|
+
:attr: *`MethodType`*\n
|
|
62
|
+
Name of the attribute of the pointed class instance. Called through `<instance@Pointer>.attr`. **Only getter** defined.\n
|
|
58
63
|
---
|
|
59
|
-
|
|
60
64
|
## Currently supported
|
|
61
65
|
Both global and local variables can be pointed at.
|
|
62
66
|
|
|
63
|
-
Literals are **not** supported because of it being useless.
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
+
Literals are **not** supported because of it being useless. Literals do **not** work anymore.
|
|
68
|
+
The only use for introducing a literal instead of a referenced value is for the class code to bind the instance
|
|
69
|
+
to an unknown reference pointing to the given value or to display all the references pointing to the given literal
|
|
70
|
+
if there is more than one.
|
|
67
71
|
"""
|
|
68
|
-
|
|
72
|
+
#* METHODS
|
|
73
|
+
# Constructor (__init__)
|
|
74
|
+
def __init__(self,value=None,reference:str|None=None,*,attr:str|None=None,local:bool=False):
|
|
69
75
|
"""
|
|
70
76
|
Arguments:
|
|
71
|
-
value (`Any`,Optional): Object to point to. If want to point to a class instance atribute,
|
|
77
|
+
value (`Any`, Optional): Object to point to. If want to point to a class instance atribute, pass to this argument the class instance without the atribute.
|
|
78
|
+
reference (`str`|`None`, Optional): Name linked to the value to point to. Useful in case there are multiple references pointing to the same value.
|
|
72
79
|
attr (`str`|`None`, Optional): Atribute of the class instance to which you want to point. Leave empty if `value` is not a class instance.
|
|
73
80
|
local (`bool`, Optional): Indicates if the value to point to is a local variable (`True` for yes and `False` for no). `False` by default.
|
|
74
81
|
"""
|
|
@@ -79,70 +86,134 @@ class Pointer(Generic[TypeVar("Any")]):
|
|
|
79
86
|
self._value=value
|
|
80
87
|
self._vars_dict=vars_dict
|
|
81
88
|
self._attr=attr
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
break
|
|
95
|
-
else:
|
|
96
|
-
print("Error, introduce the correct variable name for the 'value' parameter:")
|
|
97
|
-
name=name_aux
|
|
98
|
-
del name_aux
|
|
99
|
-
elif len(name)==1:
|
|
100
|
-
name=name[0]
|
|
101
|
-
elif len(name)==0:
|
|
102
|
-
name=None
|
|
89
|
+
if self._attr and self._attr not in dir(self._value):
|
|
90
|
+
raise AttributeError(f"\"{attr}\" is not an attribute of \"{self._value}\"")
|
|
91
|
+
if reference:
|
|
92
|
+
if reference in vars_dict and vars_dict[reference] is value:
|
|
93
|
+
name=reference
|
|
94
|
+
elif reference not in vars_dict:
|
|
95
|
+
raise NameError(f"Name \"{reference}\" is not defined")
|
|
96
|
+
elif vars_dict[reference] is not value:
|
|
97
|
+
raise ValueError(f"Name \"{reference}\" doesn't point to given value ({value})")
|
|
98
|
+
else:
|
|
99
|
+
name=[key for key,v in vars_dict.items() if v is value]
|
|
100
|
+
name=name if len(name)!=0 else [None]
|
|
103
101
|
self._name=name
|
|
104
|
-
|
|
102
|
+
if self._name==None:
|
|
103
|
+
raise NameError(f"No reference is pointing to given value \"{self._value}\"")
|
|
104
|
+
|
|
105
|
+
# Point to
|
|
106
|
+
def point_to(self,reference:str|None=None,value=None,*,attr:str|None=None):
|
|
107
|
+
"""
|
|
108
|
+
Changes the address which the pointer points to.\n
|
|
109
|
+
---
|
|
110
|
+
Arguments:
|
|
111
|
+
reference (`str`|`None`, Optional): Reference pointing to the desired value. If wanted class attribute, introduce the reference for the class object.
|
|
112
|
+
value (`Any`|`None`, Optional): Value to point to. If wanted class attribute, introduce just the class object.
|
|
113
|
+
attr (`str`|`None`, Optional): Attribute of the class if class object was passed through `reference` or `value`.
|
|
114
|
+
"""
|
|
115
|
+
if not reference and not value:
|
|
116
|
+
pass
|
|
117
|
+
elif reference and value:
|
|
118
|
+
if reference in self._vars_dict and self._vars_dict[reference] is value:
|
|
119
|
+
self._name,self._value=reference,value
|
|
120
|
+
if attr:
|
|
121
|
+
if attr in dir(self._value):
|
|
122
|
+
self._attr=attr
|
|
123
|
+
else:
|
|
124
|
+
raise AttributeError(f"\"{attr}\" is not an attribute of \"{self._value}\"")
|
|
125
|
+
elif reference not in self._vars_dict:
|
|
126
|
+
raise NameError(f"Name \"{reference}\" is not defined")
|
|
127
|
+
elif self._vars_dict[reference] is not value:
|
|
128
|
+
raise ValueError(f"Name \"{reference}\" doesn't point to given value \"{value}\"")
|
|
129
|
+
elif reference:
|
|
130
|
+
if reference in self._vars_dict:
|
|
131
|
+
self._name,self._value=reference,self._vars_dict[reference]
|
|
132
|
+
if attr:
|
|
133
|
+
if attr in dir(self._value):
|
|
134
|
+
self._attr=attr
|
|
135
|
+
else:
|
|
136
|
+
raise AttributeError(f"\"{attr}\" is not an attribute of \"{self._value}\"")
|
|
137
|
+
else:
|
|
138
|
+
raise NameError(f"Name \"{reference}\" is not defined")
|
|
139
|
+
elif value:
|
|
140
|
+
self._name,self._value=[key for key,v in self._vars_dict.items() if v is value],value
|
|
141
|
+
self._name=self._name if len(self._name)!=0 else [None]
|
|
142
|
+
if self._name==None:
|
|
143
|
+
raise NameError(f"No reference is pointing to given value \"{self._value}\"")
|
|
144
|
+
if attr:
|
|
145
|
+
if attr in dir(self._value):
|
|
146
|
+
self._attr=attr
|
|
147
|
+
else:
|
|
148
|
+
raise AttributeError(f"\"{attr}\" is not an attribute of \"{self._value}\"")
|
|
149
|
+
|
|
150
|
+
# Switch reference
|
|
151
|
+
def switch_ref(self,reference:str):
|
|
152
|
+
"""
|
|
153
|
+
Allows to switch between references pointing to the same current value of the pointer.\n
|
|
154
|
+
---
|
|
155
|
+
Arguments:
|
|
156
|
+
reference (`str`): Reference to switch the pointer to.
|
|
157
|
+
"""
|
|
158
|
+
if reference in self._vars_dict and self._vars_dict[reference] is not self.value:
|
|
159
|
+
raise ValueError(f"Name \"{reference}\" doesn't point to pointer's value \"{self.value}\"")
|
|
160
|
+
elif reference not in self._vars_dict:
|
|
161
|
+
raise NameError(f"Name \"{reference}\" is not defined")
|
|
162
|
+
self._name=reference
|
|
163
|
+
|
|
164
|
+
# Print references
|
|
165
|
+
def print_refs(self):
|
|
166
|
+
"""
|
|
167
|
+
Prints all the references pointing to the same current value of the pointer.
|
|
168
|
+
"""
|
|
169
|
+
refs=[key for key,v in self._vars_dict.items() if v is self._value]
|
|
170
|
+
refs=refs if len(refs)!=0 else [None]
|
|
105
171
|
|
|
106
172
|
#* PROPERTIES
|
|
107
173
|
# Value
|
|
108
174
|
@property
|
|
109
175
|
# Getter
|
|
110
176
|
def value(self):
|
|
111
|
-
if self.
|
|
112
|
-
if self.
|
|
113
|
-
del self._value,self.
|
|
114
|
-
raise
|
|
115
|
-
elif self.
|
|
116
|
-
raise AttributeError(f"The atribute
|
|
117
|
-
return getattr(self._value,self.
|
|
177
|
+
if self.attr:
|
|
178
|
+
if self.reference not in self._vars_dict:
|
|
179
|
+
del self._value,self.attr
|
|
180
|
+
raise NameError("The class instance has already been deleted, so the pointer no longer has access to it.")
|
|
181
|
+
elif self.attr not in dir(self._value):
|
|
182
|
+
raise AttributeError(f"The atribute \"{self._attr}\" has already been deleted, so the pointer no longer has access to it.")
|
|
183
|
+
return getattr(self._value,self.attr)
|
|
118
184
|
else:
|
|
119
|
-
if self.
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
self._value=self._vars_dict[self._name]
|
|
185
|
+
if self.reference not in self._vars_dict:
|
|
186
|
+
del self._value
|
|
187
|
+
raise NameError("The variable has already been deleted, so the pointer no longer has access to it.")
|
|
188
|
+
if self._value is not self._vars_dict[self.reference]:
|
|
189
|
+
self._value=self._vars_dict[self.reference]
|
|
125
190
|
return self._value
|
|
126
191
|
# Setter
|
|
127
192
|
@value.setter
|
|
128
193
|
def value(self,value):
|
|
129
|
-
if self.
|
|
130
|
-
setattr(self._value,self.
|
|
194
|
+
if self.attr:
|
|
195
|
+
setattr(self._value,self.attr,value)
|
|
131
196
|
else:
|
|
132
197
|
self._value=value
|
|
133
|
-
if
|
|
134
|
-
self._vars_dict[self.
|
|
135
|
-
return
|
|
198
|
+
if value is not self._vars_dict[self.reference]:
|
|
199
|
+
self._vars_dict[self.reference]=value
|
|
136
200
|
# Deleter
|
|
137
201
|
@value.deleter
|
|
138
202
|
def value(self):
|
|
139
|
-
if self.
|
|
140
|
-
delattr(self._value,self.
|
|
203
|
+
if self.attr:
|
|
204
|
+
delattr(self._value,self.attr)
|
|
141
205
|
else:
|
|
142
206
|
del self._value
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
207
|
+
del self._vars_dict[self.reference]
|
|
208
|
+
# Reference
|
|
209
|
+
@property
|
|
210
|
+
# Getter
|
|
211
|
+
def reference(self):
|
|
212
|
+
return self._name
|
|
213
|
+
# Attribute
|
|
214
|
+
@property
|
|
215
|
+
def attr(self):
|
|
216
|
+
return self._attr
|
|
146
217
|
|
|
147
218
|
#* INDEXATION
|
|
148
219
|
# Getter
|
|
@@ -311,8 +382,10 @@ class Pointer(Generic[TypeVar("Any")]):
|
|
|
311
382
|
# __int__
|
|
312
383
|
def __int__(self):
|
|
313
384
|
return int(self.value)
|
|
385
|
+
# __float__
|
|
314
386
|
def __float__(self):
|
|
315
387
|
return float(self.value)
|
|
388
|
+
# __index__
|
|
316
389
|
def __index__(self):
|
|
317
390
|
return self.value
|
|
318
391
|
|
|
@@ -322,7 +395,18 @@ class Pointer(Generic[TypeVar("Any")]):
|
|
|
322
395
|
return f"{self.__class__.__name__}({self.value})"
|
|
323
396
|
# HTML representation
|
|
324
397
|
def _repr_html_(self):
|
|
325
|
-
return f"
|
|
398
|
+
return f"""
|
|
399
|
+
<table>
|
|
400
|
+
<thead>
|
|
401
|
+
<tr>
|
|
402
|
+
<th style=\"text-align: center;\">{self.reference}</th>
|
|
403
|
+
</tr>
|
|
404
|
+
</thead>
|
|
405
|
+
<tr>
|
|
406
|
+
<td style=\"text-align: center;\">{self.value}</td>
|
|
407
|
+
</tr>
|
|
408
|
+
</table>
|
|
409
|
+
"""
|
|
326
410
|
# Printing
|
|
327
411
|
def __str__(self):
|
|
328
412
|
return str(self.value)
|
|
@@ -1,10 +1,29 @@
|
|
|
1
|
-
|
|
1
|
+
#*===============================================================================================================================
|
|
2
|
+
#* LEGEND
|
|
3
|
+
#*-------------------------------------------------------------------------------------------------------------------------------
|
|
4
|
+
#! Missing
|
|
5
|
+
#& Missing unimportant
|
|
6
|
+
#? Question
|
|
7
|
+
#* Section
|
|
8
|
+
#^ Important
|
|
9
|
+
# Normal comment
|
|
10
|
+
#// Alternative or deprecated code
|
|
11
|
+
#*===============================================================================================================================
|
|
12
|
+
|
|
13
|
+
#^ The different types of comments require the "Colorful Comments Refreshed" extension for VSCode to be properly distinguished
|
|
14
|
+
|
|
15
|
+
#* IMPORTS
|
|
16
|
+
# settrace (sys)
|
|
2
17
|
from sys import settrace
|
|
18
|
+
# signature (inspect)
|
|
3
19
|
from inspect import signature
|
|
20
|
+
# wraps (functools)
|
|
4
21
|
from functools import wraps
|
|
22
|
+
# Pointer (from the core of the package)
|
|
5
23
|
from .core import Pointer
|
|
6
24
|
|
|
7
|
-
|
|
25
|
+
#* DECORATORS
|
|
26
|
+
# pointerize
|
|
8
27
|
def pointerize(func):
|
|
9
28
|
"""
|
|
10
29
|
Allows the decorated function to receive pointers instead of the normally expected values.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: memorymanagement
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.2.0
|
|
4
4
|
Summary: Adds support for memory management
|
|
5
5
|
Home-page: https://github.com/Ricardo-Werner-Rivas/memorymanagement/tree/PyPI
|
|
6
6
|
Author: Ricardo Werner Rivas
|
|
@@ -167,14 +167,10 @@ There are two branches:
|
|
|
167
167
|
|
|
168
168
|
Pull requests from TestPyPI to PyPI will only be done by the owner when a new release is ready.
|
|
169
169
|
|
|
170
|
+
### Branch merging
|
|
170
171
|
To merge branches properly with PyPI branch in your cloned repository, you will need to have the `.gitattributes` file in the PyPI branch and execute the following commands, while in repo directory, in your PowerShell:
|
|
171
172
|
```powershell
|
|
172
173
|
git config merge.keepPyPIFiles.name "Keep README.md and setup.cfg from PyPI branch on merge"
|
|
173
174
|
git config merge.keepPyPIFiles.driver "bash -c 'cp $(git rev-parse --show-toplevel)/$3 $2'"
|
|
174
175
|
```
|
|
175
|
-
|
|
176
|
-
```bash
|
|
177
|
-
git config merge.keepPyPIFiles.name "Keep README.md and setup.cfg from PyPI branch on merge"
|
|
178
|
-
git config merge.keepPyPIFiles.driver "bash -c 'cp $(git rev-parse --show-toplevel)/$3 $2'"
|
|
179
|
-
```
|
|
180
|
-
This way, READMEs and setup files will not be overwritten in the PyPI branch.
|
|
176
|
+
This way, `README.md` and `setup.cfg` files will not be overwritten in the PyPI branch.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
memorymanagement/__init__.py,sha256=Clyt9uUH0DZW36BdmWCMYNg4R2uLYYsSdsn1UgeLSJs,816
|
|
2
|
+
memorymanagement/cleaning/__init__.py,sha256=Z3KB1OxIg_3xCh4z-SP8mEyq5L9fIqVZtWsu1D88gaw,1373
|
|
3
|
+
memorymanagement/cleaning/core.py,sha256=im521d0MM1lK4Go4GvpyGMkvyWwZwOvtEFktRvAuwFs,7196
|
|
4
|
+
memorymanagement/pointers/__init__.py,sha256=bUasGBW3STzvuLc8-oCDuANF1u6OW_cKeokIidgu7qM,791
|
|
5
|
+
memorymanagement/pointers/core.py,sha256=kMuct-ZrDwbifLyQpqQUvDEnm2h1BozIk3BUxpXwMk0,16350
|
|
6
|
+
memorymanagement/pointers/decorators.py,sha256=kx41gxNhQry2RAxwdYljjBoNEjS5C_b7P1vV8vmFQ_E,3644
|
|
7
|
+
memorymanagement-1.2.0.dist-info/licenses/LICENSE,sha256=oomqnX6WpwczxhGg1lDAUrS13YL-0NFIpomyReHWgKo,1098
|
|
8
|
+
memorymanagement-1.2.0.dist-info/METADATA,sha256=bxe7t2ldXA900oIa-gQM7ArcP8-i7yKfiid6pzPT2WQ,4739
|
|
9
|
+
memorymanagement-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
10
|
+
memorymanagement-1.2.0.dist-info/top_level.txt,sha256=7SwrpC3BY9Cm6sqwu082DJE5SteRBira0LGqziTO7eQ,17
|
|
11
|
+
memorymanagement-1.2.0.dist-info/RECORD,,
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
memorymanagement/__init__.py,sha256=Clyt9uUH0DZW36BdmWCMYNg4R2uLYYsSdsn1UgeLSJs,816
|
|
2
|
-
memorymanagement/cleaning/__init__.py,sha256=zC6dWTCTP6b-E3_Q7L45i2ZK_5DrVBbjzKT2AFuXdJk,1359
|
|
3
|
-
memorymanagement/cleaning/core.py,sha256=ocx_rcmuwlXRCd-8xeKtMd_Hxkz7O5kBtsbGyeaUmKU,6819
|
|
4
|
-
memorymanagement/pointers/__init__.py,sha256=MmQnt8KtC2GTHuc-JIypjeyc_iWHJsQTvQdwZPilF34,734
|
|
5
|
-
memorymanagement/pointers/core.py,sha256=aMttcolo_IruqtwhIbKsD1Ygu4b7NJN-pRQURIBLC-o,11969
|
|
6
|
-
memorymanagement/pointers/decorators.py,sha256=NDMlexU6s123jPU0Tqny8HkMdtPsfwrzVAgjCAYpy4A,2869
|
|
7
|
-
memorymanagement-1.1.4.dist-info/licenses/LICENSE,sha256=oomqnX6WpwczxhGg1lDAUrS13YL-0NFIpomyReHWgKo,1098
|
|
8
|
-
memorymanagement-1.1.4.dist-info/METADATA,sha256=85KLTbbXgZ6fuYdSKuApp0rIcGGX7fKV323OZ4aW5gU,4941
|
|
9
|
-
memorymanagement-1.1.4.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
10
|
-
memorymanagement-1.1.4.dist-info/top_level.txt,sha256=7SwrpC3BY9Cm6sqwu082DJE5SteRBira0LGqziTO7eQ,17
|
|
11
|
-
memorymanagement-1.1.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|