Re: [Python-Dev] Micro-benchmarks for PEP 580

2018-07-10 Thread INADA Naoki
On Wed, Jul 11, 2018 at 7:47 AM Victor Stinner wrote: > > 2018-07-10 14:59 GMT+02:00 INADA Naoki : > > PyObject_CallFunction(func, "n", 42); > > > > Currently, we create temporary long object for passing argument. > > If there is protocol for expos

Re: [Python-Dev] Micro-benchmarks for PEP 580

2018-07-10 Thread INADA Naoki
On Tue, Jul 10, 2018 at 10:20 PM Antoine Pitrou wrote: > > On Tue, 10 Jul 2018 21:59:28 +0900 > INADA Naoki wrote: > > > > Then, the function is called from another C extension like this: > > > > PyObject_CallFunction(func, "n", 42); > > > >

Re: [Python-Dev] Micro-benchmarks for PEP 580

2018-07-11 Thread INADA Naoki
kes Python >> binary fatter, consume more CPU cache. Once CPU cache is start >> stashing, application performance got slower quickly. > > Now, I'd like to see benchmark numbers for that before I believe it. Macro > benchmarks, not micro benchmarks! *wink* Yes, when I try

Re: [Python-Dev] Micro-benchmarks for PEP 580

2018-07-11 Thread INADA Naoki
alls each other. I feel it's right way to simulate "Cython (not Python) as a glue language" workload. Anyway, I don't request you to show "performance impact". I request only "target application we want to optimize with PEP 580 and future optimization based o

[Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-11 Thread INADA Naoki
t too. Is there any real application which marshal.dumps() performance is critical? -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/op

Re: [Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-12 Thread INADA Naoki
On Thu, Jul 12, 2018 at 3:22 PM Serhiy Storchaka wrote: > > 12.07.18 08:43, INADA Naoki пише: > > I'm working on making pyc stable, via stablizing marshal.dumps() > > https://bugs.python.org/issue34093 > > This is not enough for making pyc stable. The order in frozese

Re: [Python-Dev] PEP 572: Do we really need a ":" in ":="?

2018-07-12 Thread INADA Naoki
e result. > I still -0 on PEP 572. But strong -1 on restart discussion about changing it. We should polish and implement it for now, not change. -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/py

Re: [Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-12 Thread INADA Naoki
On Fri, Jul 13, 2018 at 5:03 AM André Malo wrote: > > * INADA Naoki wrote: > > > Is there any real application which marshal.dumps() performance is > > critical? > > I'm using it for spooling big chunks of data on disk, exactly for the reason > that it's fa

Re: [Python-Dev] Can I make marshal.dumps() slower but stabler?

2018-07-13 Thread INADA Naoki
always: reference from object and cache. So we can use FLAG_REF always for interned string, even if refcnt==1. Let's try it and wait another issue are found. Thanks! -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https:

Re: [Python-Dev] Benchmarks why we need PEP 576/579/580

2018-07-21 Thread INADA Naoki
ersions. I used SageMath 8.3.rc1 > and Cython 0.28.4. Do you mean you backport LOAD_METHOD and fastcall to Python 2.7 for benchmarking? Reproducing it seems hard job to me... -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https

Re: [Python-Dev] Benchmarks why we need PEP 576/579/580

2018-07-21 Thread INADA Naoki
> > I am comparing calls through tp_call (A) versus optimized call paths > (B). I only need to assume that the speed improvements to (A) between > 2.7 and 3.7 are not bigger than the speed improvements to (B). > It's interesting... But I failed to build sage. It's build step is too different from

Re: [Python-Dev] Benchmarks why we need PEP 576/579/580

2018-07-23 Thread INADA Naoki
s isn't an easy discussion). > Me too. My interest is what is the best benefit / complexity ratio. -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://

Re: [Python-Dev] Benchmarks why we need PEP 576/579/580

2018-07-23 Thread INADA Naoki
On Sun, Jul 22, 2018 at 7:42 PM Jeroen Demeyer wrote: > > On 2018-07-22 08:27, INADA Naoki wrote: > > It's interesting... But I failed to build sage. > > What went wrong? > I can't install Sage into my virtual environment, so I can't run > python -m time

Re: [Python-Dev] Fw:[issue34221] Any plans to combine collections.OrderedDict with dict

2018-07-25 Thread INADA Naoki
/docs.python.org/3/library/stdtypes.html#dict No. There are some major difference. * d1 == d2 ignores order / od1 == od2 compares order * OrderedDict has move_to_end() method. * OrderedDict.pop() takes `last=True` keyword. Regards, -- INADA Naoki ___ Pytho

Re: [Python-Dev] PEP 576/579/580 benchmark: mistune

2018-07-30 Thread INADA Naoki
d_nobinding > ___ > Python-Dev mailing list > Python-Dev@python.org > https://mail.python.org/mailman/listinfo/python-dev > Unsubscribe: > https://mail.python.org/mailman/options/python-dev/songofacandy%40gmail.com -- INADA Naoki __

[Python-Dev] [PEP 576/580] Reserve one type slot for Cython

2018-07-30 Thread INADA Naoki
one abstraction; tp_ccalloffset is offset of PyCCallRoot instead of pointer to it. Py_TPFLAGS_FUNCTION_DESCRIPTOR will be removed from PEP 576 too. Regards, -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/m

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread INADA Naoki
> On 2018-07-30 15:35, INADA Naoki wrote: > > As repeatedly said, PEP 580 is very complicated protocol > > when just implementing callable object. > > Can you be more concrete what you find complicated? Maybe I can improve > the PEP to explain it more. Also, I'm open to

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread INADA Naoki
On Tue, Jul 31, 2018 at 5:46 PM Jeroen Demeyer wrote: > > On 2018-07-31 09:36, INADA Naoki wrote: > > I want to see PoC of direct C calling. > > To be honest, there is no implementation plan for this yet. I know that > several people want this feature, so it makes sense to

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread INADA Naoki
On Tue, Jul 31, 2018 at 6:14 PM Jeroen Demeyer wrote: > > On 2018-07-31 09:36, INADA Naoki wrote: > > I think PEP 580 is understandable only for people who tried to implement > > method objects. > > Is this really a problem? Do we expect that all Python developers c

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread INADA Naoki
On Tue, Jul 31, 2018 at 7:27 PM Antoine Pitrou wrote: > > On Tue, 31 Jul 2018 19:10:48 +0900 > INADA Naoki wrote: > > > > I said "So PEP 576/580 are needed only when implementing callable object". > > I showed example "functools.partial or functo

Re: [Python-Dev] [PEP 576/580] Comparing PEP 576 and 580

2018-07-31 Thread INADA Naoki
On Tue, Jul 31, 2018 at 9:55 PM Jeroen Demeyer wrote: > > On 2018-07-31 12:10, INADA Naoki wrote: > > Surely, they should understand they must use CCALL_* flags instead of > > METH_* flags when implementing fast-callable object. > > Yes indeed. But implementing a fast-

Re: [Python-Dev] PEP 579 and PEP 580: refactoring C functions and methods

2018-09-13 Thread INADA Naoki
2018年9月13日(木) 18:22 Jeroen Demeyer : > On 2018-09-13 02:26, Petr Viktorin wrote: > > > PyCCall_FASTCALL is not a macro, shouldn't it be named PyCCall_FastCall? > > What's the convention for that anyway? I assumed that capital letters > meant a "really know what you are doing" function which could

Re: [Python-Dev] SEC: Spectre variant 2: GCC: -mindirect-branch=thunk -mindirect-branch-register

2018-09-17 Thread INADA Naoki
o two topics: (1) Guard Python process from Spectre/Meltdown attack from other process, (2) Prohibit Python code attack other processes by using Spectre/Meltdown. Regards, -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail

Re: [Python-Dev] Petr Viktorin as BDFL-Delegate for PEP 580

2018-10-03 Thread INADA Naoki
2018年10月3日(水) 21:24 Jeroen Demeyer : > Hello, > > > I am well aware of the current governance issues, but several people > have mentioned that the BDFL-Delegate process can still continue for > now. Really? I don't know process to assign BDFL-delegate without BDFL. This PEP is mainly for third

Re: [Python-Dev] AIX to stable, what does that take?

2018-10-04 Thread INADA Naoki
e is a developer guide, it will take more long time than fixing issues on AIX, compared Linux, macOS, and Windows. But without this guide, it feels almost impossible to maintain AIX build to me. Regards, -- INADA Naoki ___ Python-Dev mailing list Pyth

Re: [Python-Dev] The future of the wchar_t cache

2018-10-20 Thread INADA Naoki
+1 to remove wchar_t cache. I hope we can remove it at Python 3.9 or 3.10. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40ma

Re: [Python-Dev] Inclusion of lz4 bindings in stdlib?

2018-11-29 Thread INADA Naoki
;we can use PyPI", it means "are there enough reasons make the package special enough to add to stdlib?" We don't mean "everyone can use PyPI." Regards, -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.o

Re: [Python-Dev] Lost sight

2019-01-20 Thread INADA Naoki
Hi, Serhiy. I'm so sorry about it. I hope you will get better. Please take care of yourself. ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/pytho

[Python-Dev] How about updating OrderedDict in csv and configparser to regular dict?

2019-01-30 Thread INADA Naoki
ny issue report caused by this backward incompatibility? And I think performance and memory efficiency is not so important for configparser, unlike csv. I'm * +1 about changing csv.DictReader's default dict type * +0.5 about changing configparser's default dict type. Ho

Re: [Python-Dev] How about updating OrderedDict in csv and configparser to regular dict?

2019-01-31 Thread INADA Naoki
I'm sorry, configparser is changed already. https://bugs.python.org/issue33504 On Thu, Jan 31, 2019 at 4:52 PM INADA Naoki wrote: > > Hi, > > csv.DictReader uses OrderedDict by default, from Python 3.6. > But it doesn't make sense anymore, like namedtuple._asdict(). >

Re: [Python-Dev] Making PyInterpreterState an opaque type

2019-02-19 Thread INADA Naoki
APIs with micro version is OK. If Cython start using such internal APIs, external modules from PyPI will be broken when Python is upgraded. It feels nightmare to me. So having experimental APIs only for stdlibs makes sense to me. On the other hand,

Re: [Python-Dev] Making PyInterpreterState an opaque type

2019-02-21 Thread INADA Naoki
add implementation for PyPy written in Python using PyPy's string builder [1]. [1] https://morepypy.blogspot.com/2011/10/speeding-up-json-encoding-in-pypy.html -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

[Python-Dev] Compact ordered set

2019-02-26 Thread INADA Naoki
.g. https://bugs.python.org/issue32846 ) On the other hand, new implementation will be slow on complex (heavy random add & del) case. - Any comments are welcome. And any benchmark for set workloads are very welcome. Regards, -- INADA Naoki __

Re: [Python-Dev] Compact ordered set

2019-02-26 Thread INADA Naoki
On Wed, Feb 27, 2019 at 12:37 AM Victor Stinner wrote: > > Le mar. 26 févr. 2019 à 12:33, INADA Naoki a écrit : > > - unpickle_list: 8.48 us +- 0.09 us -> 12.8 us +- 0.5 us: 1.52x slower > > (+52%)> ... > > ... > > unpickle and unpickle_list shows massiv

Re: [Python-Dev] Another update for PEP 394 -- The "python" Command on Unix-Like Systems

2019-02-26 Thread INADA Naoki
e. But this situation is changing. Google added Python 3 support to gyp. node-gyp project is working on Python 3 support for now. I think keeping PEP 394 as-is until node-gyp officially support Python 3 would helps many web developers. -- INADA Naoki

[Python-Dev] mmap & munmap loop (Was: Compact ordered set

2019-02-27 Thread INADA Naoki
> > > Ah, another interesting point, this huge slowdown happens only when bm_pickle.py > > is executed through pyperformance. When run it directly, slowdown is > > not so large. > > pyperformance runs benchmarks in a virtual environment. I don't know > if it has any impact on bm_pickle. > > Most p

Re: [Python-Dev] mmap & munmap loop (Was: Compact ordered set

2019-02-27 Thread INADA Naoki
n* in a venv. > > Le mer. 27 févr. 2019 à 11:32, Victor Stinner a > écrit : > > > > Any idea why Python calls mmap+munmap more even in a venv? > > > > Victor > > > > Le mer. 27 févr. 2019 à 10:00, INADA Naoki a > écrit : > > > > >

Re: [Python-Dev] mmap & munmap loop (Was: Compact ordered set

2019-02-27 Thread INADA Naoki
pymalloc_free(void *ctx, void *p) *nfreepools. * 4. Else there's nothing more to do. */ -if (nf == ao->ntotalpools) { +if (nf == ao->ntotalpools && ao != usable_arenas) { /* Case 1. First unlink ao from usable_arenas. */

Re: [Python-Dev] datetime.timedelta total_microseconds

2019-02-28 Thread INADA Naoki
> > I *think* this is the "correct" way to do it: > > def timedelta_to_microseconds(td): > return td.microseconds + td.seconds * 1000 + td.days * 8640 > > (hardly tested) > > -CHB > 1000? milli? micro? -- INADA Naoki __

Re: [Python-Dev] Compact ordered set

2019-02-28 Thread INADA Naoki
> dict.popitem() pops last inserted pair. So set.pop() must remove last element. https://docs.python.org/3/library/stdtypes.html#dict.popitem -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/l

Re: [Python-Dev] Summary of Python tracker Issues

2019-02-28 Thread INADA Naoki
essage. > > Issues counts and deltas: > open6998 (+13) > closed 40696 (+47) > total 47694 (+60) > > Open issues with patches: 2783 > > -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.pytho

Re: [Python-Dev] Summary of Python tracker Issues

2019-02-28 Thread INADA Naoki
ml I suspect so. See "Open issues deltas (weekly)" graph in this page. It is ended by 2/8. https://bugs.python.org/issue?@template=stats -- INADA Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/ma

Re: [Python-Dev] Summary of Python tracker Issues

2019-03-05 Thread Inada Naoki
Thank you for fixing it.Weekly status give me motivation to look issues. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python

[Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Inada Naoki
ly it's value), (b) works. At least issue reporter try this use case and be trapped by this behavior. How do you think? -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsub

Re: [Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Inada Naoki
endswith(")") else "(" + x + > ")"? That seems a bit fiddly. In this case, we recommend not using optionxform to wrap name with "()" implicitly. Use wrapped name explicitly instead. e.g. cfg["section"]["(name)"] = "valu

Re: [Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Inada Naoki
er must check test coverage for optionxform before documenting non-idempotent optionxform is allowed explicitly. I don't have motivation for that because I never used configparser in such way. The PR looks good to me for the particular case the issue describe. So I will

Re: [Python-Dev] Compact ordered set

2019-03-07 Thread Inada Naoki
cts in Python interpreter is very few than dict. And ordered set is not memory efficient for large set. Maybe, we couldn't find clear net win by this set implementation. I will stop this work at some point. Thank you, -- Inada Naoki ___ Python-

Re: [Python-Dev] configparser: should optionxform be idempotent?

2019-03-07 Thread Inada Naoki
h few words. So I agree with you. If reader may not know tech jargon widely used, teach it instead of avoid it. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] (Licensing question) backport of shutil.copyfile() functionality

2019-03-11 Thread Inada Naoki
n". I think it can be: # Copyright 2001- Python Software Foundation. # Copyright 2019- Your Name # # Following code is from Python standard library (Lib/shutil.py) # # Changelog: # * ... Regards, -- Inada Naoki ___ Python-Dev mailing list Py

[Python-Dev] Removing PendingDeprecationWarning

2019-03-21 Thread Inada Naoki
ning class, and `PendingDeprecationWarning = DeprecationWarning` for backward compatibility. How do you think? May I do it in Python 3.8? -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsu

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
backward compatibility can be kept by alias, we can be very lazy about removing it. We have `socket.error` for long time. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
On Fri, Mar 22, 2019 at 5:06 PM Victor Stinner wrote: > > Le ven. 22 mars 2019 à 08:54, Inada Naoki a écrit : > > Yes. It will be removed at some point, but not in near future. > > > > But when when backward compatibility can be kept by alias, > > we can

Re: [Python-Dev] Replacement for array.array('u')?

2019-03-22 Thread Inada Naoki
there are not much use cases found when implementing PEP 393. If there are use cases enough to keep it in stdlib, I'm OK about un-deprecate it and make it always 32bit (int32_t). -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org

Re: [Python-Dev] Replacement for array.array('u')?

2019-03-22 Thread Inada Naoki
everted in the past. https://github.com/python/cpython/commit/62bb394729a167a46d950954c4aed5f3ba7b8a69 The issue for the revert is this. https://bugs.python.org/issue13072 -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
uld not use it, it is used in third-party projects. > This benefits seems too small compared to the learning cost. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
h of DeprecationWarning and PendingDeprecationWarning are not for end users. Only FutureWarning is for end users now. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: http

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
socket.error was independent error class. It became alias of OSError from Python 3.3. There might be some small troubles. But it was small enough for Python minor versions, I think. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org ht

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
ning class for several years is very low cost compared to these cost. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-22 Thread Inada Naoki
I created the PR to deprecate PendingDeprecationWarning only in document. https://github.com/python/cpython/pull/12505 On Sat, Mar 23, 2019 at 10:18 AM Inada Naoki wrote: > > On Sat, Mar 23, 2019 at 3:02 AM Brett Cannon wrote: > > > >> > >> There might be some sma

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-23 Thread Inada Naoki
push the removal. It was just an idea. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-24 Thread Inada Naoki
ion anyway. We have many ways to deprecation: * Document only deprecation (no warning) -- no actual removal is planned. * FutureWarning -- to warn end users. * DeprecationWarning -- to warn Python developers. * PendingDeprecationWarning -- to warn Python developers. -- Inada Naoki __

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-25 Thread Inada Naoki
On Mon, Mar 25, 2019 at 8:53 PM Nick Coghlan wrote: > > On Mon, 25 Mar 2019 at 14:39, Inada Naoki wrote: > > We have many ways to deprecation: > > > > * Document only deprecation (no warning) -- no actual removal is planned. > > * FutureWarning -- to warn end u

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-27 Thread Inada Naoki
On Mon, Mar 25, 2019 at 10:11 PM Inada Naoki wrote: > > C, Rust, Java, Ruby, PHP, don't have PendingDeprecation. > Programmers only need Deprecation. Why programmers need PendingDeprecation > only in Python? > Any comments about this? I want to document PendingDeprecationW

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-03-27 Thread Inada Naoki
ml I prefer document only deprecation to PendingDeprecationWarning for somehting "It will not removed in foreseeable future. But it will probably removed in the future." Note that -Wd and testing tool enable both of PendingDeprecationWarning and DeprecationWarning. If we use Pendi

Re: [Python-Dev] PEP 578: Python Runtime Audit Hooks

2019-03-29 Thread Inada Naoki
ill become more important tool. https://techcommunity.microsoft.com/t5/Windows-Kernel-Internals/DTrace-on-Windows/ba-p/362902 Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsu

Re: [Python-Dev] Removing PendingDeprecationWarning

2019-04-01 Thread Inada Naoki
ng nowadays. DeprecationWarning is recommended in general. """ https://github.com/python/cpython/pull/12505/files#diff-4d7187c7266c3f79727d358de3b3d228 -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.or

Re: [Python-Dev] New Python Initialization API

2019-04-05 Thread Inada Naoki
nterpreter at first. For example, vim initializes Python when Python is used first time. On the other hand, C locale coercion should be done ASAP application starts. I think dedicated API for coercing C locale is better than preconfig. // When application starts: Py_CoerceCLocale(warn=0); // lat

[Python-Dev] Proposal: dict.with_values(iterable)

2019-04-12 Thread Inada Naoki
it -o zip_dict.json -s 'keys = tuple("abcdefg"); values=[*range(7)]' 'dict(zip(keys, values))' $ ./python -m perf timeit -o with_values.json -s 'keys = dict.fromkeys("abcdefg"); values=[*range(7)]' 'keys.with_values(values)' $ ./python -m perf compare_t

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-12 Thread Inada Naoki
gt; dict? A dict view contains a reference to the iterated dict > (dictiterobject.di_dict). I think it is possible. > > I'm fine with dict.with_values() API, but I'm asking if it could be > written differently. > > Victor I implemented it as instance method of dict beca

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-12 Thread Inada Naoki
eed to rewrite the code to use > the new special method. But this optimization may slow down when creating one dict... > > The interface of dict is already overloaded. It contains many methods > which most users use rarely (and therefore which are not kept in the > working set

[Python-Dev] PEP 7: Adding anonymous union / struct

2019-04-17 Thread Inada Naoki
ymous union / struct? Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] PEP 7: Adding anonymous union / struct

2019-04-17 Thread Inada Naoki
t we can align it more explicitly by using anonymous union, without adding many `.gc.` again. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https:/

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-20 Thread Inada Naoki
See https://bugs.python.org/issue32596 ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-20 Thread Inada Naoki
"import typing" is slow too. 2019年4月21日(日) 1:43 Ilya Kamenshchikov : > alright, so would an import under TYPE_CHECKING guard be an option? like: > > from typing import TYPE_CHECKING > if TYPE_CHECKING: > from .process import ProcessPoolExecutor > from .thread import ThreadPoolExecutor > >

Re: [Python-Dev] Concurrent.futures: no type discovery for PyCharm

2019-04-22 Thread Inada Naoki
On Tue, Apr 23, 2019 at 4:40 AM Brett Cannon wrote: > > On Sat, Apr 20, 2019 at 2:10 PM Inada Naoki wrote: >> >> "import typing" is slow too. > > But is it so slow as to not do the right thing here and use the 'typing' > module as expected? I don

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-22 Thread Inada Naoki
ared keys... My current idea is adding builder in somewhere in stdlib (maybe collections?): builder = DictBuilder(keys_tuple) value = builder(values) # repeatedly called. I don't want to add new mapping type because we already have shared key dict, and changing mappi

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-22 Thread Inada Naoki
s are not only for Python, but for all mapping implementations using hash table. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-23 Thread Inada Naoki
On Tue, Apr 23, 2019 at 2:54 PM Steve Dower wrote: > > On 22Apr2019 2143, Inada Naoki wrote: > > On Tue, Apr 23, 2019 at 11:30 AM Steve Dower wrote: > >> > >> Or possibly just "dict(existing_dict).update(new_items)". > >> > > > > Do

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-23 Thread Inada Naoki
en creating key sharing dict? That's one form of my proposal :) -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-23 Thread Inada Naoki
her than CPython. > > A singular purpose isn't necessarily an obvious advantage. We're better > off with generic building blocks that our users can compose in ways that > were originally non-obvious (and then as patterns emerge we can look at > ways to simplify or formalis

Re: [Python-Dev] Proposal: dict.with_values(iterable)

2019-04-23 Thread Inada Naoki
On Wed, Apr 24, 2019 at 6:17 AM Mark Shannon wrote: > > Hi, > > On 12/04/2019 2:44 pm, Inada Naoki wrote: > > Hi, all. > > > > I propose adding new method: dict.with_values(iterable) > > You can already do something like this, if memory saving is the mai

Re: [Python-Dev] RFC: PEP 587 "Python Initialization Configuration": 2nd version

2019-05-04 Thread Inada Naoki
e on Unix nowadays. Is it impossible to use just char* on Unix and wchar_t* on Windows? -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailma

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-20 Thread Inada Naoki
* I don't want to use 3rd party library for such single script files. I'd like to add transparent decompression to argparse if fileinput is deprecated. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mai

Re: [Python-Dev] PEP 594: Removing dead batteries from the standard library

2019-05-22 Thread Inada Naoki
ybe, the module requires some domain specific knowledge and it is very far from Python core development. Domain expert will maintain it well than Python core developers. So I don't think "it is still used" is not always equal to "Python core developers should ma

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-23 Thread Inada Naoki
sorting become O(N^2). That's too bad. I'm trying address order instead. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailm

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-23 Thread Inada Naoki
. I believe this is not jitter caused from NUMA or something else in cloud. -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org/mailman/options/python

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-23 Thread Inada Naoki
> > It's relatively easy to test replacing our custom allocators with the > system ones, yes? Can we try those to see whether they have the same > characteristic? > Yes. PYTHONMALLOC=malloc LD_PRELOAD=/path/to/jemalloc.so python script.py I will try it tomorrow. > _

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-23 Thread Inada Naoki
On Fri, May 24, 2019 at 3:49 AM Gregory P. Smith wrote: > > I suggest filing a bug to track this... > I created the issue: https://bugs.python.org/issue37029 -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.p

[Python-Dev] PEP 594 -- Bundling libraries?

2019-05-24 Thread Inada Naoki
orrectly. When people use venv, they need to `pip install nntplib` (we may be able to use PyPI's namespace beta feature here). But I assume `pip install` is not a problem for people using venv. Regards, -- Inada Naoki ___ Python-Dev mailing list P

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-24 Thread Inada Naoki
$ LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1 PYTHONMALLOC=malloc local/bin/python3 t1.py 1098.4383037820007 -- end train, start del 117.93938426599925 -- end In this case, glibc malloc is the fastest. glibc is know to weak about fragmentation. But

[Python-Dev] Per opcode cache for LOAD_GLOBAL

2019-05-29 Thread Inada Naoki
://github.com/methane/sandbox/tree/master/2019/opcache_load_global#opcache-for-load_global -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org https://mail.python.org/mailman/listinfo/python-dev Unsubscribe: https://mail.python.org

Re: [Python-Dev] Have a big machine and spare time? Here's a possible Python bug.

2019-05-31 Thread Inada Naoki
h hindsight) problem - but is > that the _only_ gross design flaw here? I started r5a.4xlarge EC2 instance and started arena.py. I will post the result in next 12 hours. Regards, -- Inada Naoki ___ Python-Dev mailing list Python-Dev@python.org h

[Python-Dev] PyAPI_FUNC() is needed to private APIs?

2019-06-13 Thread Inada Naoki
unnecessary exported functions? (e.g. slower calling invention is used, bothering link time optimization, LoadLibrary get slower, etc...) Regards, -- Inada Naoki ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python

[Python-Dev] Re: PyAPI_FUNC() is needed to private APIs?

2019-06-13 Thread Inada Naoki
llexport-dllimport?view=vs-2019 It seems dllexport doesn't affect to calling convention. https://clang.llvm.org/docs/LTOVisibility.html https://devblogs.microsoft.com/oldnewthing/?p=2123 It seems dllexport affects linker. At least, linker can not remove dllexport-ed function even if the function

[Python-Dev] Re: PyAPI_FUNC() is needed to private APIs?

2019-06-13 Thread Inada Naoki
bject_GetMethod in private/ (with PyAPI_FUNC) in 3.9, for users like Cython. If you want to make it public in 3.9, please create new thread. Let's discuss about how it is useful, and current name and signature are good enough to make it public. Regards, -- Inada Naoki __

[Python-Dev] Re: radix tree arena map for obmalloc

2019-06-14 Thread Inada Naoki
ytrace; regex_compile; > regex_effbot; scimark_lu; scimark_monte_carlo; scimark_sor; > sqlalchemy_declarative; sqlite_synth; sympy_integrate; sympy_sum; > sympy_str; telco; unpack_sequence; unpickle; xml_etree_iterparse > ___ >

[Python-Dev] Re: radix tree arena map for obmalloc

2019-06-16 Thread Inada Naoki
4 42 256 1.5625 400 40 384 2.34375 416 39 160 0.9765625 432 37 400 2.44140625 448 36 256 1.5625 464 35 144 0.87890625 480 34 64 0.390625 496 32 512 3.125 512 31 512 3.125 ``` Another way to fix these problems is shrinking SMALL_REQUEST_THRESHOLD to 256 and believe malloc works well fo

[Python-Dev] Re: radix tree arena map for obmalloc

2019-06-17 Thread Inada Naoki
On Mon, Jun 17, 2019 at 5:18 PM Antoine Pitrou wrote: > > On Mon, 17 Jun 2019 11:15:29 +0900 > Inada Naoki wrote: > > > > Increasing pool size is one obvious way to fix these problems. > > I think 16KiB pool size and 2MiB (huge page size of x86) arena size is >

[Python-Dev] Re: radix tree arena map for obmalloc

2019-06-17 Thread Inada Naoki
crease arena size. People who want to use huge page may have a problem to solve by huge page. But I don't have it. Regards, -- Inada Naoki ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python

[Python-Dev] _Py_Identifier should support non-ASCII string?

2019-06-20 Thread Inada Naoki
_PyUnicode_FromId to use _PyUnicode_FromASCII? Regards, -- Inada Naoki ___ Python-Dev mailing list -- python-dev@python.org To unsubscribe send an email to python-dev-le...@python.org https://mail.python.org/mailman3/lists/python-dev.python.org/ Message

<    1   2   3   4   5   6   >