[issue44921] dict subclassing is slow

2021-08-19 Thread Marco Sulla
Marco Sulla added the comment: Since probably Monica are taking her holidays, I try to decipher her answer. Probably, the more problematic function spotted by Monica is update_one_slot. I re-quote her sentence: update_one_slot looks for the parent implementation by trying to find the

[issue44921] dict subclassing is slow

2021-08-17 Thread Marco Sulla
Marco Sulla added the comment: I not finished my phrase. I'm sure that if there's a way to turn lemons into lemonade, she is **MUCH** more skilled than me to find one. -- ___ Python tracker <https://bugs.python.o

[issue44921] dict subclassing is slow

2021-08-17 Thread Marco Sulla
Marco Sulla added the comment: Since my knowledge of this is very poor, I informed Monica about the issue. I'm quite sure that if there's a way to turn lemons into lemonade :) -- ___ Python tracker <https://bugs.python.o

[issue44921] dict subclassing is slow

2021-08-15 Thread Marco Sulla
New submission from Marco Sulla : I asked on SO why subclassing dict makes the subclass much slower in some operations. This is the answer by Monica (https://stackoverflow.com/a/59914459/1763602): Indexing and in are slower in dict subclasses because of a bad interaction between a dict

[issue39940] Micro-optimizations to PySequence_Tuple()

2021-08-05 Thread Marco Sulla
Marco Sulla added the comment: Close it, I have no time now :-( -- resolution: -> later stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.or

[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2020-12-02 Thread Marco Sulla
Marco Sulla added the comment: The PR will probably be rejected... you can do something like this: 1. in the venv on our machine, do `pip freeze`. This gives you the whole list of installed dependencies 2. download all the packages using `pip download` 3. copy all the packages on the cloud

[issue41835] Speed up dict vectorcall creation using keywords

2020-11-01 Thread Marco Sulla
Marco Sulla added the comment: I did PGO+LTO... --enable-optimizations --with-lto -- ___ Python tracker <https://bugs.python.org/issue41835> ___ ___ Python-bug

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-31 Thread Marco Sulla
Marco Sulla added the comment: Well, actually Serhiy is right, it does not seem that the macro benchs did show something significant. Maybe the code can be used in other parts of CPython, for example in _pickle, where dicts are loaded. But it needs also to expose, maybe internally only

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-30 Thread Marco Sulla
Marco Sulla added the comment: Well, following your example, since split dicts seems to be no more supported, I decided to be more drastic. If you see the last push in PR 22346, I do not check anymore but always resize, so the dict is always combined. This seems to be especially good for

[issue42141] Speedup various dict inits

2020-10-25 Thread Marco Sulla
Marco Sulla added the comment: Well, after a second thought I think you're right, there's no significant advantage and too much duplicated code. -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.py

[issue42141] Speedup various dict inits

2020-10-25 Thread Marco Sulla
Marco Sulla added the comment: The fact is that, IMHO, PGO will "false" the results, since it's quite improbable that in the test battery there's a test of creation of a dict from another dict with an hole. It seems to me that the comparison between the normal builds

[issue42141] Speedup various dict inits

2020-10-25 Thread Marco Sulla
Marco Sulla added the comment: Note that this time I've no slowdown in the macro bench, since I used normal builds, not optimized ones. I suppose an optimized build will show slowdown because the new functions are not in the test ba

[issue42141] Speedup various dict inits

2020-10-25 Thread Marco Sulla
Marco Sulla added the comment: I'm quite sure I not invented the wheel :) but I think it's a good improvement: | pathlib | 35.8 ms | 35.1 ms| 1.02x faster | Significant (t=13.21) | | scimark_monte_carlo | 176 ms | 172 ms

[issue42141] Speedup various dict inits

2020-10-24 Thread Marco Sulla
New submission from Marco Sulla : The PR #22948 is an augmented version of #22346. It speeds up also the creation of: 1. dicts from other dicts that are not "perfect" (combined and without holes) 2. fromkeys 3. copies of dicts with many holes 4. dict from keywords, as in #22346

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-24 Thread Marco Sulla
Marco Sulla added the comment: I commented out sqlalchemy in the requirements.txt in the pyperformance source code, and it worked. I had also to skip tornado: pyperformance run -r -b,-sqlalchemy_declarative,-sqlalchemy_imperative,-tornado_http -o ../perf_master.json This is my result

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Marco Sulla
Marco Sulla added the comment: @Mark.Shannon I tried to run pyperformance, but wheel does not work for Python 3.10. I get the error: AssertionError: would build wheel with unsupported tag ('cp310', 'cp310', 'linux_x86_64') --

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-23 Thread Marco Sulla
Marco Sulla added the comment: @methane: well, to be honest, I don't see much difference between the two pulls. The major difference is that you merged insertdict_init in dict_merge_init. But I kept insertdict_init separate on purpose, because this function can be used in other f

[issue41835] Speed up dict vectorcall creation using keywords

2020-10-22 Thread Marco Sulla
Marco Sulla added the comment: Another bench: python -m pyperf timeit --rigorous "dict(ihinvdono='doononon', gowwondwon='nwog', bdjbodbob='nidnnpn', nwonwno='vndononon', dooodbob='iohiwipwgpw', doidonooq='ndwnnpnpnp', fn

[issue41901] Added some explaining to pickle errors.

2020-10-02 Thread Marco Sulla
Marco Sulla added the comment: I closed it for this reason: https://github.com/python/cpython/pull/22438#issuecomment-702794261 -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue41901] Added some explaining to pickle errors.

2020-10-01 Thread Marco Sulla
Marco Sulla added the comment: I do not remember the problem I had, but when I experimented with frozendict I get one of these errors. I failed to understand the problem so I added the additional info. Maybe adding an assert in debug mode? It will be visible only to devs

[issue41901] Added some explaining to pickle errors.

2020-10-01 Thread Marco Sulla
New submission from Marco Sulla : All pickle error messages in typeobject.c was a generic "cannot pickle 'type' object". Added some explaining for every individual error. -- components: Interpreter Core messages: 377747 nosy: Marco Sulla priority: normal pull_requ

[issue41835] Speed up dict vectorcall creation using keywords

2020-09-23 Thread Marco Sulla
Marco Sulla added the comment: > `dict(**o)` is not common use case. Could you provide some other benchmarks? You can do python -m timeit -n 200 "dict(key1=1, key2=2, key3=3, key4=4, key5=5, key6=6, key7=7, key8=8, key9=9, key10=10)" or with pyperf. In this case, sinc

[issue41835] Speed up dict vectorcall creation using keywords

2020-09-22 Thread Marco Sulla
New submission from Marco Sulla : I've done a PR that speeds up the vectorcall creation of a dict using keyword arguments. The PR in practice creates a insertdict_init(), a specialized version of insertdict. I quote the comment to the function: Same to insertdict but specialize

[issue39940] Micro-optimizations to PySequence_Tuple()

2020-03-11 Thread Marco Sulla
New submission from Marco Sulla : This is a little PR with some micro-optimizations to the PySequence_Tuple() function. Mainly, it simply add a support variable new_n_tmp_1 instead of reassigning newn multiple times. -- components: Interpreter Core messages: 363974 nosy: Marco Sulla

[issue39842] partial_format()

2020-03-04 Thread Marco Sulla
Marco Sulla added the comment: @Eric V. Smith: that you for your effort, but I'll never use an API marked as private, that is furthermore undocumented. -- ___ Python tracker <https://bugs.python.org/is

[issue39842] partial_format()

2020-03-04 Thread Marco Sulla
Marco Sulla added the comment: > What would "{} {}".partial_format({}) return? `str.partial_format()` was proposed exactly to avoid such tricks. > It is not possible to implement a "safe" variant of str.format(), > because in difference to Template it can call ar

[issue39848] Warning: 'classifiers' should be a list, got type 'tuple'

2020-03-04 Thread Marco Sulla
Change by Marco Sulla : -- resolution: -> duplicate stage: -> resolved status: open -> closed type: -> behavior ___ Python tracker <https://bugs.python

[issue19610] Give clear error messages for invalid types used for setup.py params (e.g. tuple for classifiers)

2020-03-04 Thread Marco Sulla
Marco Sulla added the comment: This is IMHO broken. 1. _ensure_list() allows strings, because, documentation says, they are split in finalize_options(). But finalize_options() does only split keywords and platforms. It does _not_ split classifiers. 2. there's no need that key

[issue39842] partial_format()

2020-03-04 Thread Marco Sulla
Marco Sulla added the comment: > Do you have some concrete use case for this? Yes, for EWA: https://marco-sulla.github.io/ewa/ Since it's a code generator, it uses templates a lot, and much times I feel the need for a partial substitution. In the end I solved with some ugl

[issue39848] Warning: 'classifiers' should be a list, got type 'tuple'

2020-03-04 Thread Marco Sulla
New submission from Marco Sulla : I got this warning. I suppose that `distutils` can use any iterable. -- components: Distutils messages: 363354 nosy: Marco Sulla, dstufft, eric.araujo priority: normal severity: normal status: open title: Warning: 'classifiers' should be a

[issue39820] Bracketed paste mode for REPL

2020-03-04 Thread Marco Sulla
Marco Sulla added the comment: IMHO such a feature is useful for sysops that does not have a graphical interface, as Debian without an X. That's why vi is (unluckily) very popular also in 2020. IDLE can't be used in this cases. Windows users can't remotely login withou

[issue39842] partial_format()

2020-03-03 Thread Marco Sulla
New submission from Marco Sulla : In `string` module, there's a very little known class `Template`. It implements a very simple template, but it has an interesting method: `safe_substitute()`. `safe_substitute()` permits you to not fill the entire Template at one time. On the contrar

[issue39820] Bracketed paste mode for REPL

2020-03-03 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, but my original "holistic" proposal was rejected and it was suggested to me to propose only relevant changes, and one for issue. Now you say exactly the contrary. I feel a bit confused. PS: yes, I can, and I use, IPython. But IMHO IPytho

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-03 Thread Marco Sulla
Marco Sulla added the comment: I agree with Pablo Galindo Salgado: https://bugs.python.org/issue35912#msg334942 The "quick and dirty" solution is to change MAINCC to CC, for _testembed.c AND python.c (g++ fails with both). After that, _testembed.c and python.c should be changed s

[issue39820] Bracketed paste mode for REPL

2020-03-03 Thread Marco Sulla
Marco Sulla added the comment: Please read the message of Terry J. Reed: https://bugs.python.org/issue38747#msg356345 I quote the relevant part below > Skipping the rest of your post, I will just restate why I closed this > issue. > > 1. It introduces too many features

[issue39820] Bracketed paste mode for REPL

2020-03-02 Thread Marco Sulla
Marco Sulla added the comment: > Is this even possible in a plain text console? Yes. See Jupyter Console (aka IPython). -- ___ Python tracker <https://bugs.python.org/issu

[issue39820] Bracketed paste mode for REPL

2020-03-01 Thread Marco Sulla
New submission from Marco Sulla : I suggest to add an implementation of bracketed paste mode in the REPL. Currently if you, for example, copy & paste a piece of Python code to see if it works, if the code have a blank line without indentation and the previous and next line are indented,

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: Furthermore, I have not understood a think: if I understood well, --with-cxx-main is used on _some_ platforms that have problems with C++ extensions. What platforms? Is there somewhere a unit test for testing if Python compiled on one of these platforms with

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: Okay... if I have understood well, the problem is with C++ Extensions. Some questions: 1. does this problem exists yet? 2. if yes, maybe Python have to wrap the python.c and _testembed.c so they can also be compiled with a C++ compiler? 3. --with-cxx-main is

[issue39813] test_ioctl skipped -- Unable to open /dev/tty

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: OS: Lubuntu 18.04.4 Steps to reproduce: sudo apt-get install git libbz2-dev liblzma-dev uuid-dev libffi-dev libsqlite3-dev libreadline-dev libssl-dev libgdbm-dev libgdbm-compat-dev tk-dev libncurses5-dev git clone https://github.com/python/cpython.git cd

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: Mmmm... wait a moment. It seems the behavior is intended: https://bugs.python.org/issue1324762 I quote: The patch contains the following changes: [...] 2) The compiler used to translate python's main() function is stored in the configure / Mak

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: https://github.com/python/cpython/pull/18721 -- ___ Python tracker <https://bugs.python.org/issue39697> ___ ___ Python-bugs-list m

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Change by Marco Sulla : -- keywords: +patch pull_requests: +18079 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18721 ___ Python tracker <https://bugs.python.org/issu

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-03-01 Thread Marco Sulla
Marco Sulla added the comment: The problem is here: Programs/_testembed.o: $(srcdir)/Programs/_testembed.c $(MAINCC) -c $(PY_CORE_CFLAGS) -o $@ $(srcdir)/Programs/_testembed.c `MAINCC` in my Makefile is `g++-9`. Probably, MAINCC is set to the value of ``--with-cxx-main`, if

[issue39813] test_ioctl skipped -- Unable to open /dev/tty

2020-03-01 Thread Marco Sulla
New submission from Marco Sulla : During `make test`, I get the error in the title. (venv_3_9) marco@buzz:~/sources/cpython_test$ ll /dev/tty crw-rw-rw- 1 root tty 5, 0 Mar 1 15:24 /dev/tty -- components: Tests messages: 363063 nosy: Marco Sulla priority: normal severity: normal

[issue39788] Exponential notation should return an int if it can

2020-02-29 Thread Marco Sulla
Marco Sulla added the comment: > >>> int(1e100) > 1159028911097599180468360808563945281389781327557747838772170381060813469985856815104 . Oh my God... I'm just more convinced than before :-D > Ya, this change will never be made - give up gracef

[issue39788] Exponential notation should return an int if it can

2020-02-29 Thread Marco Sulla
Marco Sulla added the comment: All the examples you mentioned seems to me to fix code, instead of breaking it. About 1e300**1, it's not a bug at all. No one can stop you to full your RAM in many other ways :-D About conventions, it does not seems to me that Python cares about

[issue39788] Exponential notation should return an int if it can

2020-02-29 Thread Marco Sulla
Marco Sulla added the comment: Sorry, but I can't figure out what code can break this change. Integers are implicitly converted to floats in operations with floats. How can this change break old code? > if you are worried about the performance No, I'm worried about the ex

[issue39788] Exponential notation should return an int if it can

2020-02-28 Thread Marco Sulla
New submission from Marco Sulla : (venv_3_9) marco@buzz:~/sources/python-frozendict$ python Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux Type "help", "copyright", "credits" or "license" for more inf

[issue39784] Tuple comprehension

2020-02-28 Thread Marco Sulla
New submission from Marco Sulla : I think a tuple comprehension could be very useful. Currently, the only way to efficiently create a tuple from a comprehension is to create a list comprehension (generator comprehensions are more slow) and convert it with `tuple()`. A tuple comprehension

[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-26 Thread Marco Sulla
Marco Sulla added the comment: > I also distinctly remember seeing code (and writing such code myself) that > performs computation on timeouts and does not care if the end value goes > below 0. This is not a good statistics. Frankly we can't measure the impact of the cha

[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-26 Thread Marco Sulla
Change by Marco Sulla : -- resolution: not a bug -> rejected ___ Python tracker <https://bugs.python.org/issue39698> ___ ___ Python-bugs-list mailing list Un

[issue34396] Certain methods that heap allocated subtypes inherit suffer a 50-80% performance penalty

2020-02-26 Thread Marco Sulla
Marco Sulla added the comment: I asked why on StackOverflow, and an user seemed to find the reason. The problem for him/her is in `update_one_slot()`. `dict` implements directly `__contains__()` and `__getitem__()`. Usually, `sq_contains` and `mp_subscript` are wrapped to implement

[issue39754] update_one_slot() does not inherit sq_contains and mp_subscript if they are explictly declared

2020-02-26 Thread Marco Sulla
Change by Marco Sulla : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue39754> ___ ___

[issue39754] update_one_slot() does not inherit sq_contains and mp_subscript if they are explictly declared

2020-02-25 Thread Marco Sulla
New submission from Marco Sulla : I noticed that `__contains__()` and `__getitem__()` of subclasses of `dict` are much slower. I asked why on StackOverflow, and an user seemed to find the reason. The problem for him/her is that `dict` implements directly `__contains__()` and `__getitem__

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-02-23 Thread Marco Sulla
Marco Sulla added the comment: I think in this case the error is more trivial: simply `Programs/_testembed.c` is compiled with g++ but it should be compiled with gcc. Indeed, there are much gcc-only options in the compilation of `Programs/_testembed.c`, and g++ complains about them

[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-23 Thread Marco Sulla
Marco Sulla added the comment: I see that many breaking changes was done in recent releases. I get only the ones for `asyncio` in Python 3.8: https://bugs.python.org/issue36921 https://bugs.python.org/issue36373 https://bugs.python.org/issue34790 https://bugs.python.org/issue32528 https

[issue39695] Failed to build _uuid module, but libraries was installed

2020-02-20 Thread Marco Sulla
Marco Sulla added the comment: Ah, well, this is not possible. I was banned from the mailing list. I wrote my "defense" to conduct...@python.org in date 2019-12-29, and I'm still waiting for a response... -- ___ Python

[issue39695] Failed to build _uuid module, but libraries was installed

2020-02-20 Thread Marco Sulla
Marco Sulla added the comment: Well, the fact is, basically, for the other libraries you have not to re-run `configure`. You have to install only the missing C libraries and redo `make`. This works, for example, for zlib, lzma, ctypes, sqlite3, readline, bzip2. Furthermore, it happened to

[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-20 Thread Marco Sulla
Marco Sulla added the comment: > I recall very many cases in third-party libraries and commercial applications Source? -- ___ Python tracker <https://bugs.python.org/issu

[issue39698] asyncio.sleep() does not adhere to time.sleep() behavior for negative numbers

2020-02-20 Thread Marco Sulla
New submission from Marco Sulla : Python 3.9.0a3+ (heads/master-dirty:f2ee21d858, Feb 19 2020, 23:19:22) [GCC 9.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import time >>> time.sleep(-1

[issue39697] Failed to build with --with-cxx-main=g++-9.2.0

2020-02-20 Thread Marco Sulla
New submission from Marco Sulla : I tried to compile Python 3.9 with: CC=gcc-9.2.0 ./configure --enable-optimizations --with-lto --with-cxx-main=g++-9.2.0 make -j 2 I got this error: g++-9.2.0 -c -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -flto -fuse-linker-plugin

[issue39696] Failed to build _ssl module, but libraries was installed

2020-02-20 Thread Marco Sulla
New submission from Marco Sulla : Similarly to enhancement request #39695, I missed to install the debian package with the include files for SSL, before compiling Python 3.9. After installed it, `make` continued to not find the libraries and skipped the creation of module _ssl. Searching on

[issue39695] Failed to build _uuid module, but libraries was installed

2020-02-20 Thread Marco Sulla
New submission from Marco Sulla : When I first done `make` to compile Python 3.9, I did not installed some debian development packages, like `uuid-dev`. So `_uuid` module was not built. After installed the debian package I re-run `make`, but it failed to build `_uuid` module. I had to edit

[issue39516] ++ does not throw a SyntaxError

2020-02-04 Thread Marco Sulla
Marco Sulla added the comment: > this is the sort of thing that is usually best suited to be reported by > linters, not the Python runtime. TL;DR: if you write something like `a -- b`, it's quite extraordinary that you really wanted to write this. You probably wanted to write

[issue39516] ++ does not throw a SyntaxError

2020-02-01 Thread Marco Sulla
Marco Sulla added the comment: > `++` isn't special Indeed the problem is that no error or warning is raised if two operators are consecutive, without a space between. All the cases you listed are terribly unreadable and hardly intelligible. Anyway I do not agree `++` is not

[issue39516] ++ does not throw a SyntaxError

2020-02-01 Thread Marco Sulla
Marco Sulla added the comment: > This is not a bug No one said it's a bug. It's a defect. > This has been part of Python since version 1 There are many things that was part of Python 1 that was removed. > `++` should never be an operator in the future, precisely because

[issue39516] ++ does not throw a SyntaxError

2020-02-01 Thread Marco Sulla
New submission from Marco Sulla : Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux Type "help", "copyright", "credits" or "license" for more information. >>> 1 ++ 2 3 This is probably because

[issue11986] Min/max not symmetric in presence of NaN

2019-12-23 Thread Marco Sulla
Marco Sulla added the comment: marco@buzz:~$ python3.9 Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from decimal

[issue36095] Better NaN sorting.

2019-12-23 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, ignore my previous post. -- ___ Python tracker <https://bugs.python.org/issue36095> ___ ___ Python-bugs-list mailin

[issue36095] Better NaN sorting.

2019-12-23 Thread Marco Sulla
Marco Sulla added the comment: marco@buzz:~$ python3.9 Python 3.9.0a0 (heads/master-dirty:d8ca2354ed, Oct 30 2019, 20:25:01) [GCC 9.2.1 20190909] on linux Type "help", "copyright", "credits" or "license" for more information. >>> from decimal

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, I had an epiphany. NaN returns False for every comparison. So in teory any element of the iterable should result minor that NaN. So NaN should treated as the highest element, and should be at the end of the sorted result! Indeed this is the

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: > No idea what "are minor that another object" could possibly mean. Oh my god... a < b? > I don't know what purpose would be served by checking ">=" too Well, it's very simple. Since the sorting algorithm checks if

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: Anyway, Java by default puts NaNs at the end of the iterable: https://onlinegdb.com/SJjuiXE0S -- ___ Python tracker <https://bugs.python.org/issue36

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, but have you, Dickinson and Peters, read how I propose to check if the object is orderable or not? I explained it in a very detailed way, and this does not change the float comparison. And does not need to check first if the iterable it totally

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, a little errata: > After the current object a is checked against the object b, if > `all_orderables` is true [...] must be change to > After the current object a is checked against the object b, ***if the check > returns fal

[issue36095] Better NaN sorting.

2019-12-15 Thread Marco Sulla
Marco Sulla added the comment: I'm in favor of a `math.total_ordering` function, but IMHO sorting functions should emit a warning if they contains an unorderable objects. This can be done easily: I suppose the sorting function checks if the objects of the iterable are minor that an

[issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode

2019-11-11 Thread Marco Sulla
Marco Sulla added the comment: @Terry: > Jupyter Console is, I read, QT based Nope. It's shell based by default. You can open it also as a QT app, like IDLE, but by default `jupyter console` is via terminal. > they must use "‘magic’ commands" entered after the '

[issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode

2019-11-10 Thread Marco Sulla
Marco Sulla added the comment: @Eryk: why a C extension apart and not a patch to `readline`? -- ___ Python tracker <https://bugs.python.org/issue38747> ___ ___

[issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode

2019-11-10 Thread Marco Sulla
Marco Sulla added the comment: Steven: currently I'm developing `frozendict` as part of CPython. About IDLE, IDLE can't be used on a server without a GUI. Furthermore, I *really* hope that IDLE is simply a GUI wrapper of REPL, with some additiona

[issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode

2019-11-10 Thread Marco Sulla
Marco Sulla added the comment: Well, maybe too much feature requests in a single report. I'll report them separately, with more rationale. -- ___ Python tracker <https://bugs.python.org/is

[issue38747] Slowly introduce a subset of Jupyter console (IPython) features into CPython command line interactive mode

2019-11-08 Thread Marco Sulla
New submission from Marco Sulla : Sometimes I’m lazy and I would test code copy - pasted from internet or from other sources directly in the interpreter, in interactive mode. But if the code contains completely blank lines, the copy - paste fails. For example: def f(): print("

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-07 Thread Marco Sulla
Marco Sulla added the comment: When Python started to emulate the other languages? Who cares about what other languages do? Python uses `raise` instead of `throw`, even if `throw` is much more popular in the most used languages, only because `raise` in English has more sense. And IMHO a

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-07 Thread Marco Sulla
Marco Sulla added the comment: Excuse me for the spam, but against make it the default behavior I have a simple consideration: what will expect a person that reads the code, that doesn't know Python? IMHO it expects that the string is *exactly* like it's written. The fact that

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-07 Thread Marco Sulla
Marco Sulla added the comment: Anyway there's something strange in string escaping and `inspect.cleandoc()`: >>> a = """ ... \nciao ... bello ... \ ciao ... """ >>> print(inspect.cleandoc(a)) ciao bello \ ciao >>> pri

[issue36906] Compile time textwrap.dedent() equivalent for str or bytes literals

2019-11-06 Thread Marco Sulla
Marco Sulla added the comment: If I can say my two cents: 1. I preferred that the default behaviour of multi-line was to dedent. But breaking old code, even if for a little percentage of code, IMHO is never a good idea. Py2->Py3 should have proved it. 2. ``` remembers me too much

[issue38569] Unknown distribution option: 'license_files'

2019-10-23 Thread Marco Sulla
New submission from Marco Sulla : I tried to add to `setuptools.setup()` the argument license_files. It works, but I get this warning: /usr/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'license_files' I suppose the warning can

[issue37918] What about an enum for open() modes?

2019-08-30 Thread Marco Sulla
Marco Sulla added the comment: @vstinner Note that I wrote about os.fdopen(), not os.open(). -- ___ Python tracker <https://bugs.python.org/issue37918> ___ ___

[issue37918] What about an enum for open() modes?

2019-08-30 Thread Marco Sulla
Marco Sulla added the comment: Well, I'll discuss it in python-ideas. Let me do the testament before... :D @serhiy.storchaka thank you for the StrEnum tip, but no PyPi package please. It has no sense to add an addional package only for having an enum that should be built-in as in all

[issue37918] What about an enum for open() modes?

2019-08-29 Thread Marco Sulla
Marco Sulla added the comment: Excuse me, but this is not a bug report, but a feature request. Indeed there's the possibility to submit also enhancements, not only bugs, as in all bug reporting board worthy of respect. You see the Type select with "Enhancement"

[issue37918] What about an enum for open() modes?

2019-08-28 Thread Marco Sulla
Marco Sulla added the comment: Mh. No one is interested? -- ___ Python tracker <https://bugs.python.org/issue37918> ___ ___ Python-bugs-list mailing list Unsub

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-22 Thread Marco Sulla
Marco Sulla added the comment: Thanks, but telling the truth: 1. I just not use SubElement, even if it's more convenient. I just create an Element and I append to the parent one. It's much more clear IMHO 2. I do not use `fromstring` and all its friends. It was just a sugges

[issue37918] What about an enum for open() modes?

2019-08-22 Thread Marco Sulla
New submission from Marco Sulla : As title. I just created it: https://pastebin.com/pNYezw2V I think it could be useful to have a more descriptive way to declare a file open mode. Many languages has an enum for this. Maybe open(), os.fdopen(), os.popen() and pathlib.Path.open() can just

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-21 Thread Marco Sulla
Marco Sulla added the comment: @rhettinger: "Deprecating [...] just cause disruption to existing, deployed code" How? Deprecating is used just to maintain intact the already existing code... "Please do not go down of the path of making yourself the arbiter of what is Pytho

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-21 Thread Marco Sulla
Marco Sulla added the comment: @scoder: 1. the fact that == does not traverse the Element is IMHO unpythonic and non-standard. A trivial example: >>> a = {1: {2: 3}} >>> b = {1: {2: 3}} >>> a == b True You can have a dictionary complicated as you want, but if th

[issue37792] xml.etree.ElementTree.Element.__eq__ does compare only objects identity

2019-08-08 Thread Marco Sulla
New submission from Marco Sulla : Currectly, even if two `Element`s elem1 and elem2 are different objects but the tree is identical, elem1 == elem2 returns False. The only effective way to compare two `Element`s is ElementTree.tostring(elem1) == ElementTree.tostring(elem2) Furthermore, from

[issue37791] Propose to deprecate `ignore_errors` and `onerror` parameters of `shutil.rmtree()`

2019-08-08 Thread Marco Sulla
New submission from Marco Sulla : I propose to mark as deprecated the parameters `ignore_errors` and `onerror` of `shutil.rmtree()`, and raise a warning if used. The reason is I feel them unpythonic. For emulating `ignore_errors=True`, the code can be written simply with a `try-except` that

[issue37791] Propose to deprecate ignore_errors,

2019-08-08 Thread Marco Sulla
Change by Marco Sulla : -- nosy: Marco Sulla priority: normal severity: normal status: open title: Propose to deprecate ignore_errors, ___ Python tracker <https://bugs.python.org/issue37

[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2019-06-16 Thread Marco Sulla
Marco Sulla added the comment: > I don't like the idea of changing what VIRTUAL_ENV gets set to when I > believe you should recreate the virtual environment as necessary and > risk surprising people who expect VIRTUAL_ENV to function as it does > today and has for years.

[issue36964] `python3 -m venv NAME`: virtualenv is not portable

2019-06-07 Thread Marco Sulla
Marco Sulla added the comment: Please Mr. Cannon, can you read my last posts? I think they are not describing a mad idea, but something reasonable. -- nosy: +brett.cannon ___ Python tracker <https://bugs.python.org/issue36

  1   2   >