Re: check if bytes is all nulls

2018-04-01 Thread Arkadiusz Bulski
Thanks, timeit gives `not any(key)` same performance as `sum(key)==0`. niedz., 1 kwi 2018 o 21:03 użytkownik Kirill Balunov < kirillbalu...@gmail.com> napisał: > 2018-04-01 20:55 GMT+03:00 Arkadiusz Bulski : > >> What would be the most performance efficient way of checking if

Re: check if bytes is all nulls

2018-04-01 Thread Arkadiusz Bulski
0.1092393600010837 In [13]: timeit('x==x2', 'x=bytes(10); z=bytes(1); x2=bytes(10)') Out[13]: 0.05795672599924728 niedz., 1 kwi 2018 o 19:55 użytkownik Arkadiusz Bulski < arek.bul...@gmail.com> napisał: > What would be the most performance efficient way of checking

check if bytes is all nulls

2018-04-01 Thread Arkadiusz Bulski
of key is unknown, could be few bytes, could be megabytes. -- ~ Arkadiusz Bulski -- https://mail.python.org/mailman/listinfo/python-list

Re: Since when builtin dict preserve key order?

2018-03-24 Thread Arkadiusz Bulski
What exactly do you mean its present but not guaranteed? Do you mean its a property of CPython 3.6 implementation but not Python as a standard? sob., 24 mar 2018 o 21:33 użytkownik Dan Stromberg napisał: > On Fri, Mar 23, 2018 at 9:34 PM, Arkadiusz Bulski > wrote: > > I already a

Since when builtin dict preserve key order?

2018-03-23 Thread Arkadiusz Bulski
I already asked on PYPY and they confirmed that any version of pypy, including 2.7, has dict preserving insertion order. I am familiar with ordered **kw which was introduced in 3.6 but I also heard that builtin dict preserves order since 3.5. Is that true? -- ~ Arkadiusz Bulski -- https

Re: List slicing on Python 2.7

2018-03-15 Thread Arkadiusz Bulski
Found the answer on stack overflow. Some types on some runtimes (builtins and on Python 2) use another method __getslice__ instead of __getitem__. https://docs.python.org/2/reference/datamodel.html#object.__getslice__ czw., 15 mar 2018 o 12:54 użytkownik Arkadiusz Bulski napisał: > I hav

List slicing on Python 2.7

2018-03-15 Thread Arkadiusz Bulski
://github.com/construct/construct/blob/8839aac2b68c9e8240e9d9c041a196b0a7aa7d9b/tests/test_core.py#L1148 https://travis-ci.org/construct/construct/jobs/353782126#L887 -- ~ Arkadiusz Bulski -- https://mail.python.org/mailman/listinfo/python-list

Re: __import__ fails randomly due to missing file

2018-03-12 Thread Arkadiusz Bulski
I inserted importlib.invalidate_caches() instead of os.sync() and at a glance, it seems to have fixed it. Big thanks Paul! pon., 12 mar 2018 o 11:00 użytkownik Paul Moore napisał: > On 12 March 2018 at 09:12, Arkadiusz Bulski wrote: > > Hi, > > > > For the record,

__import__ fails randomly due to missing file

2018-03-12 Thread Arkadiusz Bulski
/construct/construct/blob/d9c645ed0a75b5a2b64318113cf69cac822fd8f5/construct/core.py#L179-L180 -- ~ Arkadiusz Bulski ~ tel 503 357 111 lub WhatsApp/Telegram -- https://mail.python.org/mailman/listinfo/python-list