On 21/07/2022 23:39, Marco Sulla wrote:
I've done this other simple test:
#!/usr/bin/env python3
import tracemalloc
import gc
import pickle
tracemalloc.start()
snapshot1 = tracemalloc.take_snapshot().filter_traces(
(tracemalloc.Filter(True, __file__), )
)
for i in range(1000):
pi
I've done this other simple test:
#!/usr/bin/env python3
import tracemalloc
import gc
import pickle
tracemalloc.start()
snapshot1 = tracemalloc.take_snapshot().filter_traces(
(tracemalloc.Filter(True, __file__), )
)
for i in range(1000):
pickle.dumps(iter([]))
gc.collect()
snapsh
Do you know of a library that resolves schedules like every Wednesday
at 3:00pm to absolute time, that is return the datetime of the next
occurrence?
It may be as simple, as this to add seven days, assuming a slip of a second
is not important or even a hour when things change.
Enddate = Beg
This naif code shows no leak:
import resource
import pickle
c = 0
while True:
pickle.dumps(iter([]))
if (c % 1) == 0:
max_rss = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss
print(f"iteration: {c}, max rss: {max_rss} kb")
c += 1
--
https://mail.python.org/
On Thu, 21 Jul 2022 at 22:28, MRAB wrote:
>
> It's something to do with pickling iterators because it still occurs
> when I reduce func_76 to:
>
> @trace
> def func_76():
> pickle.dumps(iter([]))
It's too strange. I found a bunch of true memory leaks with this
decorator. It seems to be relia
On 21/07/2022 20:47, Marco Sulla wrote:
I tried to check for memory leaks in a bunch of functions of mine using a
simple decorator. It works, but it fails with this code, returning a random
count_diff at every run. Why?
import tracemalloc
import gc
import functools
from uuid import uuid4
import
On Thursday, July 21, 2022 at 8:19:34 PM UTC+1, rambius wrote:
> Hello,
>
> Do you know of a library that resolves schedules like every Wednesday
> at 3:00pm to absolute time, that is return the datetime of the next
> occurrence?
>
> Regards
> rambius
>
> P.S.
>
> --
> Tangra Mega Rock:
I tried to check for memory leaks in a bunch of functions of mine using a
simple decorator. It works, but it fails with this code, returning a random
count_diff at every run. Why?
import tracemalloc
import gc
import functools
from uuid import uuid4
import pickle
def getUuid():
return str(uuid
> Do you know of a library that resolves schedules like every Wednesday
> at 3:00pm to absolute time, that is return the datetime of the next
> occurrence?
Take a look at the `rrule` module in the `dateutil` package:
https://dateutil.readthedocs.io/en/stable/rrule.html
Skip
--
https://mail.pyth
Hello,
Do you know of a library that resolves schedules like every Wednesday
at 3:00pm to absolute time, that is return the datetime of the next
occurrence?
Regards
rambius
P.S.
--
Tangra Mega Rock: http://www.radiotangra.com
--
https://mail.python.org/mailman/listinfo/python-list
Thanks. That cdef-locals concept is consistent with the following example:
def f():
i = 1
def g(): print('i' in globals(), 'i' in locals())
def h(): print('i' in globals(), 'i' in locals()); i
g()
h()
f()
False False
False True
It is a mystery, which may be why the documentat
On 2022-07-20 4:45 PM, Chris Angelico wrote:
On Wed, 20 Jul 2022 at 23:50, Peter Otten <__pete...@web.de> wrote:
I found
https://peps.python.org/pep-3101/
"""
PEP 3101 – Advanced String Formatting
...
An example of the ‘getitem’ syntax:
"My name is {0[name]}".format(dict(name='Fred'))
It sh
12 matches
Mail list logo