[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2022-04-04 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: -Anthony Sottile ___ Python tracker <https://bugs.python.org/issue45847> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2022-04-02 Thread Anthony Sottile
Anthony Sottile added the comment: I could, but it's very unlikely to get fixed given I believe 18.04 is in security-only fixes and backporting a pkg-config file seems unlikely this worked two days ago before this patch -- ___ Python tracker

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2022-04-02 Thread Anthony Sottile
Anthony Sottile added the comment: the `tk-dev` package on ubuntu bionic does not ship with a `pkg-config` file for tk so it does not build properly there: ``` root@f0dd06a3e87c:/cpython# dpkg -L tk8.6-dev | grep pc root@f0dd06a3e87c:/cpython# ``` (a note: bionic reaches end of life

[issue45847] Port module setup to PY_STDLIB_MOD() macro and addext()

2022-04-02 Thread Anthony Sottile
Anthony Sottile added the comment: this appears to break the tkinter extension for ubuntu bionic (18.04) -- I'm not entirely sure on the correct fix here but I get the following from trying to build there: 2022-04-02T15:52:08.0910452Z Python build finished successfully! 2022-04-02T15:52

[issue47152] Reorganize the re module sources

2022-04-02 Thread Anthony Sottile
Anthony Sottile added the comment: would it be possible to expose `parse_template` -- or at least some way to validate that a regex replacement string is correct prior to executing the replacement? I'm currently using that for my text editor: https://github.com/asottile/babi/blob

[issue46491] typing: allow Annotated in outermost scope

2022-01-25 Thread Anthony Sottile
Anthony Sottile added the comment: 3.7.2 has another example where OrderedDict was added to typing I don't have any personal investment in this particular change but I've had quite a few unhappy consumers of libraries due to instability in typing apis between patch versions in the past (heh

[issue46491] typing: allow Annotated in outermost scope

2022-01-25 Thread Anthony Sottile
Anthony Sottile added the comment: to me this is the same as the Union[Pattern] / Union[Match] "fixes" that landed in 3.5.3 -- and the pain caused by using that and having CI pass (because of modern 3.5.x) but having spurious bug reports from users stuck on 3.5.2 or in 3.6.1 when

[issue46491] typing: allow Annotated in outermost scope

2022-01-25 Thread Anthony Sottile
Anthony Sottile added the comment: should this behaviour change be backported? it potentially creates an annoying edgecase where code seemingly works unless you use an older patch version since this isn't a bugfix I wouldn't expect this to land in 3.9 and 3.10 -- nosy: +Anthony

[issue44295] self.assertDictContainsSubset warning is unhelpful

2021-11-01 Thread Anthony Sottile
Anthony Sottile added the comment: looks like this was removed in 3.11 -- wondering if it's still worth correcting the deprecation warning location -- versions: +Python 3.10 -Python 3.11 ___ Python tracker <https://bugs.python.org/issue44

[issue39214] Add curses.window.in_wch

2021-11-01 Thread Anthony Sottile
Anthony Sottile added the comment: rebased this onto 3.11 -- versions: +Python 3.11 -Python 3.9 ___ Python tracker <https://bugs.python.org/issue39214> ___ ___

[issue45548] Update Modules/Setup

2021-10-27 Thread Anthony Sottile
Anthony Sottile added the comment: I'm seeing some weird breakage in the deadsnakes builds, presumably due to this change: ``` ... 2021-10-27T08:55:21.9485959Z x86_64-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -g -fdebug-prefix-map=/tmp/code

[issue45165] alighment format for nullable values

2021-09-10 Thread Anthony Sottile
Anthony Sottile added the comment: alignment was the only one I found which was applicable and didn't work `!s` "works" but it's kind of a hack (of course I want string formatting, I'm making a string!) -- then I would want to write `!s` everywhere which is cumbersom

[issue45165] alighment format for nullable values

2021-09-10 Thread Anthony Sottile
New submission from Anthony Sottile : currently this works correctly: ``` >>> '%8s %8s' % (None, 1) 'None1' ``` but conversion to f-string fails: ``` >>> f'{None:>8} {1:>8}' Traceback (most recent call last): File "", line 1, in TypeError

[issue39562] Asynchronous comprehensions don't work in asyncio REPL

2021-08-24 Thread Anthony Sottile
Anthony Sottile added the comment: this maybe shouldn't have been backported to 3.8.x as the change in compiler flags appears to break pyc files in subtle ways: https://stackoverflow.com/q/68910329/812183 -- nosy: +Anthony Sottile ___ Python

[issue33671] Efficient zero-copy for shutil.copy* functions (Linux, OSX and Win)

2021-07-31 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile nosy_count: 19.0 -> 20.0 pull_requests: +26032 pull_request: https://github.com/python/cpython/pull/27516 ___ Python tracker <https://bugs.python.org/issu

[issue44467] profiling-compatible functools.wraps

2021-06-20 Thread Anthony Sottile
New submission from Anthony Sottile : this is a small proposal to add a new function to the functools module which provides better profiling-compatible `@functools.wraps(...)` the rationale comes from https://github.com/Yelp/named_decorator (which is dead / abandoned) the tl;dr from

[issue44297] Frame with -1 line number

2021-06-19 Thread Anthony Sottile
Anthony Sottile added the comment: here is a minimal reproduction: ```python def iterboom(): raise AssertionError yield 1 next(1 for x in iterboom()) ``` python 3.9: ``` $ python3.9 t.py Traceback (most recent call last): File "/tmp/rinohtype/t.py", line 5, in ne

[issue44459] 3.10b2 -> 3.10b3 regression in importlib.metadata for rinoh

2021-06-19 Thread Anthony Sottile
New submission from Anthony Sottile : installed from git: ``` $ git remote -v origin https://github.com/brechtm/rinohtype.git (fetch) origin https://github.com/brechtm/rinohtype.git (push) $ git rev-parse HEAD 4054539bae53eaddd10291c8429a1a32aeeb4786 ``` working in 3.10 b2: ```console

[issue44297] Frame with -1 line number

2021-06-18 Thread Anthony Sottile
Anthony Sottile added the comment: here's the traceback pytest is trying to display and crashing: ``` Traceback (most recent call last): File "/tmp/rinohtype/venv/lib/python3.10/site-packages/_pytest/runner.py", line 311, in from_call result: Optional[TResult] = func()

[issue44297] Frame with -1 line number

2021-06-18 Thread Anthony Sottile
Anthony Sottile added the comment: this appears to have regressed in 3.10 as well according to some reports on pytest: https://github.com/pytest-dev/pytest/pull/8227#issuecomment-864327090 -- nosy: +Anthony Sottile, pablogsal versions: +Python 3.10

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-08 Thread Anthony Sottile
Anthony Sottile added the comment: they are directly coupled which is why I commented here the api redesign forces O(N) lookups and O(N) constructions which directly impact performance causing the regression -- resolution: fixed -> status: closed ->

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-06-08 Thread Anthony Sottile
Anthony Sottile added the comment: here's the performance regressions, they affect any callers of `distributions()` and are even worse on callers of the new apis. a call to distributions() is about 3x slower than in 3.9 here is the setup I am using: virtualenv venv39 -ppython3.9 venv39/bin

[issue44295] self.assertDictContainsSubset warning is unhelpful

2021-06-07 Thread Anthony Sottile
Change by Anthony Sottile : -- components: +Library (Lib) type: -> behavior ___ Python tracker <https://bugs.python.org/issue44295> ___ ___ Python-bugs-lis

[issue44307] date.today() is half as fast as datetime.now().date()

2021-06-04 Thread Anthony Sottile
Anthony Sottile added the comment: *terry.reedy oops typo! -- ___ Python tracker <https://bugs.python.org/issue44307> ___ ___ Python-bugs-list mailing list Unsub

[issue44307] date.today() is half as fast as datetime.now().date()

2021-06-04 Thread Anthony Sottile
Anthony Sottile added the comment: @terry.reddy -- I believe your title change makes this more difficult to understand -- ___ Python tracker <https://bugs.python.org/issue44

[issue44307] date.today() is 2x slower than datetime.now().date()

2021-06-03 Thread Anthony Sottile
New submission from Anthony Sottile : ```console $ python3.10 -m timeit -s 'from datetime import datetime' 'datetime.now().date()' 50 loops, best of 5: 708 nsec per loop $ python3.10 -m timeit -s 'from datetime import date' 'date.today()' 20 loops, best of 5: 1.4 usec per loop

[issue44296] Should warnings.warn default to stacklevel=2?

2021-06-02 Thread Anthony Sottile
New submission from Anthony Sottile : I have yet to come across a usecase where `stacklevel=1` makes sense -- usually it is more helpful to point at the calling code than the function which is itself warning my proposal is to update the default for `stacklevel=` from `1` to `2` an example

[issue44295] self.assertDictContainsSubset warning is unhelpful

2021-06-02 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +25093 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26497 ___ Python tracker <https://bugs.python.org/issu

[issue44295] self.assertDictContainsSubset warning is unhelpful

2021-06-02 Thread Anthony Sottile
New submission from Anthony Sottile : it's missing stacklevel= -- mostly creating a bpo issue to link to -- messages: 394953 nosy: Anthony Sottile priority: normal severity: normal status: open title: self.assertDictContainsSubset warning is unhelpful versions: Python 3.11

[issue44277] cpython forks are spammed with dependabot PRs

2021-05-31 Thread Anthony Sottile
New submission from Anthony Sottile : for example: https://github.com/asottile/cpython/pull/1 -- messages: 394842 nosy: Anthony Sottile priority: normal severity: normal status: open title: cpython forks are spammed with dependabot PRs ___ Python

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-31 Thread Anthony Sottile
Anthony Sottile added the comment: it does not, it restores apis but in a way which requires a huge performance hit to avoid deprecation warnings it also still has the 2-500x performance regression I've stated above -- ___ Python tracker <ht

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: I have also shown that the performance is indeed not better in the nominal case, as demonstrated in the first case -- ___ Python tracker <https://bugs.python.org/issue44

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: the toil is still present, the existing, good apis are deprecated and the new, bad apis are slow -- and the odd subclasses are still present -- ___ Python tracker <https://bugs.python.org/issue44

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: oops, tiny typo in those code examples, they should say `group=` instead of `name=` -- though the performance is unchanged: (first example) ```console $ ./venv39/bin/python t.py 0.6641988754272461 $ ./venv310/bin/python t.py 1.3172023296356201 ``` (second

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: the `.select(...)` api is at least twice as slow as indexing as well: setup: ``` virtualenv venv39 -p python3.9 venv39/bin/pip install flake8 pytest pytest-randomly virtualenv venv39 -p python3.10 venv310/bin/pip install flake8 pytest pytest-randomly

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: also https://github.com/miurahr/aqtinstall/issues/221 (this links to importlib-metadata tracker, not sure how you missed it) -- ___ Python tracker <https://bugs.python.org/issue44

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-30 Thread Anthony Sottile
Anthony Sottile added the comment: I also need `.sort(key=...)` for what it's worth, the error in this issue was just the first encountered I think my only satisfactory outcome would be: - the original api returns actual dicts - the sub-api returns actual lists - the new select

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-27 Thread Anthony Sottile
Anthony Sottile added the comment: > Which types are sneaky and look like built-in types but do not act like them? well for starters, there's the tuple subclass which pretends to be a dict. but it violates substitutability for both `tuple` and `Mapping` so it's not useful in eit

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-27 Thread Anthony Sottile
Anthony Sottile added the comment: personally I think they should be reverted -- they were not committed in spirit with the backwards compatibility policy: https://www.python.org/dev/peps/pep-0387/#making-incompatible-changes - I don't think they were discussed thoroughly, and when

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-27 Thread Anthony Sottile
Anthony Sottile added the comment: the "what's new" mentions nothing of this break, nor the aggressive deprecation warnings, nor the various shifted interfaces (such as this one): https://docs.python.org/3.10/whatsnew/3.10.html#importli

[issue44247] bpo stacktrace linkifier does not understand 3.10+

2021-05-27 Thread Anthony Sottile
New submission from Anthony Sottile : for instance in this issue: https://bugs.python.org/issue44246 it links to 3.1/... instead of 3.10/... -- messages: 394549 nosy: Anthony Sottile priority: normal severity: normal status: open title: bpo stacktrace linkifier does not understand

[issue44246] 3.10 beta 1: breaking change in importlib.metadata entry points

2021-05-27 Thread Anthony Sottile
New submission from Anthony Sottile : this is breaking code that's unfortunately out of my control (vendor) -- also it looks really wrong ```python import importlib.metadata print('looks like a list:') print(importlib.metadata.distribution('pip').entry_points) print('first item:') print

[issue44184] crash on windows invoking flake8

2021-05-21 Thread Anthony Sottile
Anthony Sottile added the comment: that version of flake8 uses multiprocessing (even for 1 file) -- would the ast objects be involved in that way? (pyflakes also makes reference cyles to handle "parent" relationships) -- ___ Pyth

[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile
Anthony Sottile added the comment: would it maybe be helpful to bisect a history where the dataclasses / inspect import change is introduced earlier? this would perhaps help pinpoint the other commit which is causing this? -- ___ Python tracker

[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile
Anthony Sottile added the comment: vstinner I showed the directions above, but here they are again: venv\Scripts\pip install flake8==3.6.0 venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes -- ___ Python tracker

[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile
Anthony Sottile added the comment: ah sorry, the branch got squash-merged this is the equivalent revision after the merge: f3b1b44bf3d2d5927004fa1c2fcf1ab2def816b9 -- ___ Python tracker <https://bugs.python.org/issue44

[issue44184] crash on windows invoking flake8

2021-05-20 Thread Anthony Sottile
Anthony Sottile added the comment: everything in this virtualenv is pure python so I don't think it's a faulty third party extension module -- ___ Python tracker <https://bugs.python.org/issue44

[issue44184] crash on windows invoking flake8 under tox

2021-05-19 Thread Anthony Sottile
Anthony Sottile added the comment: I can reproduce it outside of tox using: venv\Scripts\pip install flake8==3.6.0 venv\Scripts\pip install -e . --no-deps # ignore the conflict, but fix pyflakes C:\Users\asott\AppData\Local\Temp\y\pyflakes>venv\Scripts\flake8.exe setup.py C:\Users\as

[issue44184] crash on windows invoking flake8 under tox

2021-05-19 Thread Anthony Sottile
New submission from Anthony Sottile : I installed python using the installers from python.org -- I originally reproduced this using github actions using pyflakes's testsuite >ver Microsoft Windows [Version 10.0.19041.985] >venv\Scripts\python --version Python 3.10.0b1 C:\Users

[issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil

2021-05-05 Thread Anthony Sottile
Anthony Sottile added the comment: oddly enough, when I add `-X faulthandler` it passes ___ I did some research on the error message and it looks like the ubuntu maintainers have found the same thing and reported it here: https://bugs.python.org/issue36445 this points at (intentional

[issue44043] 3.10 b1 armhf Bus Error in hashlib test: test_gil

2021-05-04 Thread Anthony Sottile
New submission from Anthony Sottile : terribly sorry, I don't have much information to go off on this other than the build logs from deadsnakes. I retried this build twice and it seems it consistently fails in this position: https://launchpadlibrarian.net/537139233/buildlog_ubuntu-bionic

pytest 6.2.4 has been released!

2021-05-04 Thread Anthony Sottile
to all of the contributors to this release: * Anthony Sottile * Bruno Oliveira * Christian Maurer * Florian Bruhin * Ran Benita Happy testing, The pytest Development Team ___ Python-announce-list mailing list -- python-announce-list@python.org

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-04 Thread Anthony Sottile
Anthony Sottile added the comment: I've released pytest 6.2.4 for the other breakage (which is unrelated to this bpo -- it was the asname source position issue) -- ___ Python tracker <https://bugs.python.org/issue43

[issue40465] Deprecate the optional *random* argument to random.shuffle()

2021-05-03 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: -Anthony Sottile ___ Python tracker <https://bugs.python.org/issue40465> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-05-01 Thread Anthony Sottile
Anthony Sottile added the comment: ah yeah that's the `asname` ast change -- if you use the unreleased main branch it has a fix for that -- ___ Python tracker <https://bugs.python.org/issue43

[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`

2021-04-30 Thread Anthony Sottile
Anthony Sottile added the comment: at least for static analysis of other python constructs it's very convenient to know from a `Name` node alone whether it's being used in a read or write context -- without this information an ast traversal needs to maintain more information about whether

[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`

2021-04-30 Thread Anthony Sottile
Anthony Sottile added the comment: and actually, now that I look close it would be useful for `MatchStar` and `MatchMapping` to also use a `Name(..., ctx=Store())` for their respective parameters as well -- ___ Python tracker <ht

[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`

2021-04-30 Thread Anthony Sottile
Anthony Sottile added the comment: I'm suggesting instead of: MatchAs(pattern=None, name='foo') to have MatchAs(pattern=None, name=Name('foo', ctx=Store())) -- ___ Python tracker <https://bugs.python.org/issue43

[issue43994] change representation of match as / capture as `Name(..., ctx=Store())`

2021-04-30 Thread Anthony Sottile
New submission from Anthony Sottile : I'm looking at adding support to `match` for pyflakes, and the first impression I have is that `MatchAs` is unnecessarily different from `Name` with `ctx=Store()` if it were represented as the latter pyflakes would not require special handling of `match

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-04-30 Thread Anthony Sottile
Anthony Sottile added the comment: can confirm that pytest no longer crashes -- ___ Python tracker <https://bugs.python.org/issue43933> ___ ___ Python-bug

[issue38605] [typing] PEP 563: Postponed evaluation of annotations: enable it by default in Python 3.11

2021-04-25 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile nosy_count: 14.0 -> 15.0 pull_requests: +24316 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/25596 ___ Python tracker <https://bugs.python.org/i

[issue43933] Regression in python3.10 with traceback frame having lineno of -1

2021-04-24 Thread Anthony Sottile
New submission from Anthony Sottile : This is breaking pytest for failed assertions: https://github.com/pytest-dev/pytest/pull/8227 It also breaks the traceback in the output below Here's a minimal example: ```python class Boom: def __enter__(self): return self def __exit__

[issue43782] Failure to build from source on ppc64le on ubuntu xenial

2021-04-15 Thread Anthony Sottile
Anthony Sottile added the comment: a rebuild succeeded so I'm ok closing this :shrug: -- stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.org/i

[issue43833] Unexpected Parsing of Numeric Literals Concatenated with Boolean Operators

2021-04-13 Thread Anthony Sottile
Anthony Sottile added the comment: here's quite a few other cases as well -- I'd love for this to be clarified in PEP8 such that I can rationalize crafting a rule for it in `pycodestyle` -- https://github.com/PyCQA/pycodestyle/issues/371 -- nosy: +Anthony Sottile

[issue43782] Failure to build from source on ppc64le on ubuntu xenial

2021-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: hmmm strange, the only changes in 3.9.4 are a revert -- perhaps this is a flakey bug in gcc and not actionable I've clicked rebuild on my build, maybe it'll magically fix it plus xenial is almost end of lifed so I doubt anyone cares about this strange

[issue43782] Failure to build from source on ppc64le on ubuntu xenial

2021-04-08 Thread Anthony Sottile
New submission from Anthony Sottile : I realize this is unlikely to be a helpful report, but something that changed between 3.9.3 and 3.9.4 has caused the build to break on (admittedly a strange platform) ppc64le I attached the build log (zipped because otherwise it's too big ?) The live

[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-03-15 Thread Anthony Sottile
Anthony Sottile added the comment: I took a stab at improving the error message (see the linked PR) $ ./python -c 'import tarfile; tarfile.open("Lib/test/testtar.tar.xz")' Traceback (most recent call last): File "", line 1, in File "/home/asottile/workspace/cpyt

[issue8978] "tarfile.ReadError: file could not be opened successfully" if compiled without zlib

2021-03-13 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile nosy_count: 7.0 -> 8.0 pull_requests: +23611 pull_request: https://github.com/python/cpython/pull/24850 ___ Python tracker <https://bugs.python.org/iss

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: I haven't looked into or thought about that yet, it might not be possible It might also make sense to build new tokenize.py apis avoiding the `readline()` api -- I always found it painful to work

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: Either works for me, would you be able to point me to the starting bits as to how `_ast` becomes builtin? -- ___ Python tracker <https://bugs.python.org/issue3

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: private api sounds fine too -- I thought it was necessary to implement the module (as it needs external linkage) but if it isn't then even better -- ___ Python tracker <https://bugs.python.org/issue3

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: you already have that right now because the `tokenize` module is exposed. (except that every change to the tokenization requires it to be implemented once in C and once in python) it's much more frustrating when the two differ as well I don't think all

[issue3353] make built-in tokenizer available via Python C API

2021-01-27 Thread Anthony Sottile
Anthony Sottile added the comment: I'm interested in it because the `tokenize` module is painfully slow -- ___ Python tracker <https://bugs.python.org/issue3

[issue3353] make built-in tokenizer available via Python C API

2021-01-26 Thread Anthony Sottile
Anthony Sottile added the comment: Serhiy Storchaka is this still blocked? it's been a few years on either this or the linked issue and I'm reaching for this one :) -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue3

[issue43013] IDLE: update code, mostly by cleanups of 2.x or 2to3 artifacts

2021-01-25 Thread Anthony Sottile
Anthony Sottile added the comment: > Anthony: removing 'set' from 'list(set(interable))' is wrong if 'set' were > added to remove duplicates. It's not removed, it's changed to a set comprehension (which was added in 2.7 and 3.0) pyupgrade is very battle tested, having been run

[issue43013] IDLE: update code, mostly by cleanups of 2.x or 2to3 artifacts

2021-01-24 Thread Anthony Sottile
Anthony Sottile added the comment: just noticed this PR -- you might be interested in pyupgrade which automates some of these things -- here's (for example) `git ls-files -- Lib/idlelib | grep '\.py$' | xargs pyupgrade --py36-plus ```diff diff --git a/Lib/idlelib/calltip_w.py b/Lib/idlelib

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Anthony Sottile added the comment: attached out3.pstats / out3.svg which represent the optimization using lru_cache instead -- Added file: https://bugs.python.org/file49764/out3.svg ___ Python tracker <https://bugs.python.org/issue43

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Change by Anthony Sottile : Added file: https://bugs.python.org/file49763/out3.pstats ___ Python tracker <https://bugs.python.org/issue43014> ___ ___ Python-bugs-list m

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Anthony Sottile added the comment: admittedly anecdotal but here's another data point in addition to the profiles attached test.test_tokenize suite before: $ ./python -m test.test_tokenize

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +23130 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24311 ___ Python tracker <https://bugs.python.org/issu

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Change by Anthony Sottile : Added file: https://bugs.python.org/file49762/out2.svg ___ Python tracker <https://bugs.python.org/issue43014> ___ ___ Python-bugs-list mailin

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Change by Anthony Sottile : Added file: https://bugs.python.org/file49761/out2.pstats ___ Python tracker <https://bugs.python.org/issue43014> ___ ___ Python-bugs-list m

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
Change by Anthony Sottile : Added file: https://bugs.python.org/file49760/out.svg ___ Python tracker <https://bugs.python.org/issue43014> ___ ___ Python-bugs-list mailin

[issue43014] tokenize spends a lot of time in `re.compile(...)`

2021-01-24 Thread Anthony Sottile
New submission from Anthony Sottile : I did some profiling (attached a few files here with svgs) of running this script: ```python import io import tokenize # picked as the second longest file in cpython with open('Lib/test/test_socket.py', 'rb') as f: bio = io.BytesIO(f.read()) def

[issue36675] Doctest directives and comments missing from code samples

2021-01-04 Thread Anthony Sottile
Anthony Sottile added the comment: should the minimum sphinx version be bumped and/or this reverted: https://github.com/python/cpython/blob/f7f0ed59bcc41ed20674d4b2aa443d3b79e725f4/Doc/conf.py#L48 this change breaks, for example, sphinx 1.8.5 while building for ubuntu 20.04 The directive

[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-02 Thread Anthony Sottile
Anthony Sottile added the comment: by the way, here's a much smaller case which has a similar problem ``` x = ( f" {test(t)}" ) ``` -- ___ Python tracker <https://bugs.python.o

[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile
Anthony Sottile added the comment: I didn't initially, but now I have and it has the same bug in the current master: 3bf05327c2b25d42b92795d9d280288c22a0963d -- ___ Python tracker <https://bugs.python.org/issue42

[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile
Anthony Sottile added the comment: +peg parser individuals to nosy -- nosy: +gvanrossum, lys.nikolaou, pablogsal ___ Python tracker <https://bugs.python.org/issue42

[issue42806] Incorrect offsets in new parser for f-string substitutions

2021-01-01 Thread Anthony Sottile
New submission from Anthony Sottile : here's a sample file. this is distilled down from an example which broke a code formatter here: https://github.com/asottile/add-trailing-comma/issues/106 def f(): x = ( 'PERL_MM_OPT', ( f'INSTALL-BASE={shlex.quote(venv

[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Anthony Sottile
Anthony Sottile added the comment: indeed! that's it -- you learn something every day :) -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue42175] long lines from interactive stdin are truncated

2020-10-27 Thread Anthony Sottile
New submission from Anthony Sottile : this was originally pointed out in a comment on my youtube video here: https://youtu.be/Xf_82stIbB8 here's a reproduction: 1. produce 5000 characters of output: python3 -c 'print("a"*5000)' 2. copy that to the clipboard 3. run this: python3

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +21718 pull_request: https://github.com/python/cpython/pull/22755 ___ Python tracker <https://bugs.python.org/issue40

[issue40492] -m cProfile -o f.pstats with a script that does chdir() writes to the changed directory and not `.`

2020-10-18 Thread Anthony Sottile
Change by Anthony Sottile : -- pull_requests: +21715 pull_request: https://github.com/python/cpython/pull/22752 ___ Python tracker <https://bugs.python.org/issue40

[issue41973] Docs: TypedDict is now of type function instead of class

2020-10-08 Thread Anthony Sottile
Anthony Sottile added the comment: Seems to be due to https://bugs.python.org/issue40187 -- nosy: +Anthony Sottile, serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue41

[issue2651] Strings passed to KeyError do not round trip

2020-09-11 Thread Anthony Sottile
Anthony Sottile added the comment: (I know this is old and closed but I've just run into the same thing with pwd.getpwnam in issue41767) KeyError: "getpwnam(): name not found: 'test'" would it be possible / make sense to extend `KeyError` with a named-only-argument which woul

[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Anthony Sottile
Change by Anthony Sottile : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue41767> ___ ___ Python-bugs-list

[issue41767] KeyError exception is more difficult to read due to quoting

2020-09-11 Thread Anthony Sottile
New submission from Anthony Sottile : For example: >>> import pwd >>> pwd.getpwnam("test") Traceback (most recent call last): File "", line 1, in KeyError: "getpwnam(): name not found: 'test'" An improvement would be some

[issue20684] inspect.getfullargspec (etc) incorrectly follows __wrapped__ chains

2020-07-30 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile nosy_count: 3.0 -> 4.0 pull_requests: +20834 pull_request: https://github.com/python/cpython/pull/21100 ___ Python tracker <https://bugs.python.org/issu

[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Anthony Sottile
Anthony Sottile added the comment: awesome, I'm going to work through this with someone in my discord as a demo / mentorship opportunity -- hope that's ok! -- ___ Python tracker <https://bugs.python.org/issue41

[issue41260] datetime: strftime method takes different keyword argument: fmt (pure) or format (C)

2020-07-09 Thread Anthony Sottile
New submission from Anthony Sottile : C: https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Modules/_datetimemodule.c#L3183 pure python: https://github.com/python/cpython/blob/8b33961e4bc4020d8b2d5b949ad9d5c669300e89/Lib/datetime.py#L927 this makes it difficult

  1   2   3   4   5   >