[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2022-04-08 Thread Marco Barisione
Marco Barisione added the comment: Actually, sorry I realise I can pass `include_extras` to `get_type_hints`. Still, it would be nicer not to have to do that. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39442] from __future__ import annotations makes dataclasses.Field.type a string, not type

2022-04-08 Thread Marco Barisione
Marco Barisione added the comment: This is particularly annoying if you are using `Annotated` with a dataclass. For instance: ``` from __future__ import annotations import dataclasses from typing import Annotated, get_type_hints @dataclasses.dataclass class C: v: Annotated[int, &quo

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2022-02-17 Thread Marco Pagliaricci
Marco Pagliaricci added the comment: Andrew, many thanks for your time, solving this issue. I think your solution is the best to fix this little problem and I agree with you on backporting. My Best Regards, and thanks again. Marco On Thu, Feb 17, 2022 at 10:29 AM Andrew Svetlov wrote

[issue37295] Possible optimizations for math.comb()

2021-10-17 Thread Marco Cognetta
Change by Marco Cognetta : -- keywords: +patch nosy: +mcognetta nosy_count: 6.0 -> 7.0 pull_requests: +27293 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29020 ___ Python tracker <https://bugs.python.org/i

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci
Marco Pagliaricci added the comment: Chris, ok, I have modified the snippet of code to better show what I mean. Still here, the message of the CancelledError exception is lost, but if I comment line 10, and uncomment line 11, so I throw a ValueError("TEST"), that "TEST" st

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci
Marco Pagliaricci added the comment: Chris, I'm attaching to this e-mail the code I'm referring to. As you can see, in line 10, I re-raise the asyncio.CancelledError exception with a message "TEST". That message is lost, due to the reasons we've talked about. My point

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-09 Thread Marco Pagliaricci
Marco Pagliaricci added the comment: OK, I see your point. But I still can't understand one thing and I think it's very confusing: 1) if you see my example, inside the job() coroutine, I get correctly cancelled with an `asyncio.CancelledError` exception containing my message. 2) No

[issue45390] asyncio.Task doesn't propagate CancelledError() exception correctly.

2021-10-06 Thread Marco Pagliaricci
New submission from Marco Pagliaricci : I've spotted a little bug in how asyncio.CancelledError() exception is propagated inside an asyncio.Task. Since python 3.9 the asyncio.Task.cancel() method has a new 'msg' parameter, that will create an asyncio.CancelledError

[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

[issue44585] csv library does not correctly interpret some files

2021-07-08 Thread Marco E.
New submission from Marco E. : The CSV library does not correctly interpret files in the following format (test.csv): "A" ,"B" ,"C" "aa","bbb","" "a" ,"bb" ,"ccc" "aaa

[issue42828] Python readline module

2021-01-05 Thread Marco Franzo
Marco Franzo added the comment: So, I use Ubuntu 20.10 and the terminal is the one distributed with the system. I think this problem born in my code here: def generate_input(): while True: str = input().strip() yield helloworld_pb2.Operazione(operazione = str) I think

[issue42828] Python readline module

2021-01-05 Thread Marco Franzo
New submission from Marco Franzo : It would be better to write at the end of the program this: os.system('stty sane') because when you import readline, at the end of program, the console remains unusable -- assignee: docs@python components: Documentation messages: 384379

[issue41374] socket.TCP_* no longer available with cygwin 3.1.6+

2021-01-02 Thread Marco Atzeri
Marco Atzeri added the comment: The Analysis is correct. Removing the test for CYGWIN and always include the solved the problem building all python (3.6,3.7,3.8) packages https://sourceware.org/pipermail/cygwin-apps/2020-December/040845.html https://sourceware.org/pipermail/cygwin

[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

[issue34204] Bump the default pickle protocol in shelve

2020-10-27 Thread Marco Castelluccio
Marco Castelluccio added the comment: I've opened https://github.com/python/cpython/pull/22751 to fix this, I know there was already a PR, but it seems to have been abandoned. -- ___ Python tracker <https://bugs.python.org/is

[issue34204] Bump the default pickle protocol in shelve

2020-10-27 Thread Marco Castelluccio
Change by Marco Castelluccio : -- nosy: +marco-c nosy_count: 6.0 -> 7.0 pull_requests: +21928 pull_request: https://github.com/python/cpython/pull/22751 ___ Python tracker <https://bugs.python.org/issu

[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

[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Marco Castelluccio
Change by Marco Castelluccio : -- keywords: +patch pull_requests: +21713 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22751 ___ Python tracker <https://bugs.python.org/issu

[issue42071] Shelve should default to the default Pickle protocol instead of hardcoding version 3

2020-10-18 Thread Marco Castelluccio
New submission from Marco Castelluccio : Shelve is currently defaulting to Pickle protocol 3, instead of using Pickle's default protocol for the Python version in use. This way, Shelve's users don't benefit from improvements introduced in newer Pickle protocols, unless the

[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

[issue41740] Improve error message for string concatenation via `sum`

2020-09-07 Thread Marco Paolini
Marco Paolini added the comment: I was thinking to just clarify a bit the error message that results from Py_NumberAdd. This won't make it slower in the "hot" path doing something like (not compile tested, sorry) --- a/Python/bltinmodule.c +++ b/Python/bltinmodule.c @@ -

[issue41740] string concatenation via `sum`

2020-09-07 Thread Marco Paolini
Marco Paolini added the comment: also worth noting, the start argument is type checked instead. Maybe we could apply the same checks to the items of the iterable? python3 -c "print(sum(('a', 'b', 'c'), start='d'))" Traceback (most recent

[issue41740] string concatenation via `sum`

2020-09-07 Thread Marco Paolini
Marco Paolini added the comment: This happens because the default value for the start argument is zero , hence the first operation is `0 + 'a'` -- nosy: +mpaolini ___ Python tracker <https://bugs.python.o

[issue41472] webbrowser uses deprecated env variables to detect desktop type

2020-08-04 Thread Marco Trevisan
Change by Marco Trevisan : -- keywords: +patch pull_requests: +20875 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21731 ___ Python tracker <https://bugs.python.org/issu

[issue41472] webbrowser uses deprecated env variables to detect desktop type

2020-08-04 Thread Marco Trevisan
New submission from Marco Trevisan : Webbrowser uses env variables such as GNOME_DESKTOP_SESSION_ID that have been dropped by GNOME in recent releases -- components: Library (Lib) messages: 374806 nosy: Trevinho priority: normal severity: normal status: open title: webbrowser uses

[issue34624] -W option and PYTHONWARNINGS env variable does not accept module regexes

2020-07-08 Thread Marco Paolini
Marco Paolini added the comment: hello Thomas, do you need any help fixing the conflicts in your PR? even if Lib/warnings.py changed a little in the last 2 years, your PR is still good! -- nosy: +mpaolini ___ Python tracker <ht

[issue41185] lib2to3 generation of pickle files is racy

2020-07-01 Thread Marco Barisione
New submission from Marco Barisione : The generation of pickle files in load_grammar in lib2to3/pgen2/driver.py is racy as other processes may end up reading a half-written pickle file. This is reproducible with the command line tool, but it's easier to reproduce by importing lib2to3

[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

[issue39628] msg.walk memory leak?

2020-02-21 Thread Marco
Marco added the comment: uhm, no. I can no more reproduce this. I was wrong. Sorry for the noise. -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[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

[issue39628] msg.walk memory leak?

2020-02-13 Thread Marco
New submission from Marco : Hello, if I write ``` msg = email.message_from_bytes(...) for part in msg.walk(): content_type = part.get_content_type() if not part.get_content_maintype() == 'multipart': filename = part.get_filename(None) attachment = part.get_payload(d

[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

  1   2   3   4   5   >