[issue16806] col_offset is -1 and lineno is wrong for multiline string expressions

2019-01-12 Thread Anthony Sottile
Anthony Sottile added the comment: I agree -- probably safer to not backport to 3.7 in case someone is relying on this behaviour. -- ___ Python tracker <https://bugs.python.org/issue16

[issue35733] isinstance(ast.Constant(value=True), ast.Num) should be False

2019-01-13 Thread Anthony Sottile
New submission from Anthony Sottile : Noticing this in pyflakes https://github.com/PyCQA/pyflakes/pull/408 -- messages: 333579 nosy: Anthony Sottile priority: normal severity: normal status: open title: isinstance(ast.Constant(value=True), ast.Num) should be False versions: Python 3.8

[issue35733] isinstance(ast.Constant(value=True), ast.Num) should be False

2019-01-13 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11165, 11166 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35733] isinstance(ast.Constant(value=True), ast.Num) should be False

2019-01-13 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch, patch pull_requests: +11165, 11166, 11167 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35733] isinstance(ast.Constant(value=True), ast.Num) should be False

2019-01-13 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11165 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35733> ___ _

[issue35507] multiprocessing: seg fault when creating RawArray from numpy ctypes

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: yes, please do -- ___ Python tracker <https://bugs.python.org/issue35507> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Anthony Sottile
Change by Anthony Sottile : -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue35766> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: Seems also related to https://bugs.python.org/issue24119 with python2 / python3.5 (hopefully) rapidly falling off in usage I would assume the specialized treatment of `# type: ...` comments would become less and less necessary Though I guess there's

[issue35785] argparse crashes in gettext when processing missing arguments

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: Can you provide a reproducer? I'm having difficulty reproducing with this script: import argparse p = argparse.ArgumentParser() p.add_argument('--foo', nargs=None) args = p.parse_args() $ python3.7 --version Python 3.7.2 $ python3.7 t

[issue35766] Merge typed_ast back into CPython

2019-01-19 Thread Anthony Sottile
Anthony Sottile added the comment: > You’d be surprised how tenacious old versions are. heh that's true, at my last job we finally got rid of python2.6 in 2016 :'( anyway -- I don't mean to discourage this, definitely seems valuable to the m

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
New submission from Anthony Sottile : Unless I'm reading incorrectly: https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L30-L31 https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/c

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Anthony Sottile added the comment: looks true for os.chmod as well: https://github.com/python/cpython/blob/7a2368063f25746d4008a74aca0dc0b82f86ff7b/Modules/clinic/posixmodule.c.h#L327-L328 -- ___ Python tracker <https://bugs.python.org/issue35

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11422, 11423 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11422 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35802> ___ _

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
New submission from Anthony Sottile : This appears to be true in 3.6+ -- I'd like to add a test and documentation ensuring that going forward. Related: https://github.com/python/typeshed/issues/2749 -- assignee: docs@python components: Documentation, Tests messages: 334188

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11424 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35803> ___ _

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch, patch pull_requests: +11424, 11425, 11426 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35803] Test and document that `dir=...` in tempfile may be PathLike

2019-01-21 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11424, 11425 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-01-22 Thread Anthony Sottile
Anthony Sottile added the comment: yep! did my due diligence there, you can check my work on https://github.com/python/cpython/pull/11643 all platforms have these functions since `posixmodule.c` is always compiled and the functions in question are not guarded by preprocessor directives in

[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-28 Thread Anthony Sottile
New submission from Anthony Sottile : For instance: # `a` is an empty directory, a PEP 420 namespace package >>> import importlib.util >>> importlib.util.find_spec('a') ModuleSpec(name='a', loader=None, origin='namespace', submodule_search

[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-28 Thread Anthony Sottile
Anthony Sottile added the comment: Hmmm, it appears this was changed in python3.7 to have `None` for the origin instead of `'namespace'` -- however the `submodule_search_locations` is still not indexable: >>> importlib.util.find_spec('a') Mod

[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-28 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch, patch pull_requests: +11529, 11530, 11531 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-28 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11529 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35843> ___ _

[issue35843] importlib.util docs for namespace packages innaccurate

2019-01-28 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch, patch pull_requests: +11529, 11530 stage: -> patch review ___ Python tracker <https://bugs.python.org/issu

[issue34652] never enable lchmod on Linux

2019-02-10 Thread Anthony Sottile
Anthony Sottile added the comment: I believe this also closes https://bugs.python.org/issue31940 and https://bugs.python.org/issue28627 -- nosy: +Anthony Sottile ___ Python tracker <https://bugs.python.org/issue34

[issue36007] python3.8 a1 - docs build requires sphinx 1.7 but uses a 1.8 feature

2019-02-15 Thread Anthony Sottile
New submission from Anthony Sottile : doctest `:skipif:` was added in https://github.com/sphinx-doc/sphinx/issues/5273 Used here: https://github.com/python/cpython/blame/36433221f06d649dbd7e13f5fec948be8ffb90af/Doc/library/turtle.rst#L252-L253 Sphinx minimum version configured here: https

[issue36007] python3.8 a1 - docs build requires sphinx 1.7 but uses a 1.8 feature

2019-02-15 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +11917 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36007> ___ _

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
New submission from anthony shaw: This is related to issue26188, Using await in a simple statement (outside of an async def method) raises SyntaxError with the unhelpful message "invalid syntax". It seems obvious once you've read PEP492 in detail, but I think that as more and

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
anthony shaw added the comment: yey! I figured it out!! -- ___ Python tracker <http://bugs.python.org/issue30029> ___ ___ Python-bugs-list mailing list Unsub

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
Changes by anthony shaw : -- pull_requests: +1215 ___ Python tracker <http://bugs.python.org/issue30029> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30029] Compiler "'await' outside function" error message is unreachable

2017-04-09 Thread anthony shaw
Changes by anthony shaw : -- stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue30029> ___ ___ Python-bugs-list

[issue30155] Add ability to get/set tzinfo on datetime instances in C API

2017-04-24 Thread Anthony Tuininga
New submission from Anthony Tuininga: Right now there is no documented way to create a datetime instance with a tzinfo instance. The documented macros all hard code the value Py_None for the tzinfo parameter. Using the PyObject_Call() method instead of the macro for creating a datetime

[issue30210] No Documentation on tkinter dnd module

2017-04-29 Thread Anthony Flury
New submission from Anthony Flury: There is a level of drag and drop support within the tkinter package - namely the tkinter.dnd module. However there is no documentation at this time about drag and drop either on docs.python.org or on the tkinter reference manual. The only documentation

[issue30338] LC_ALL=en_US + io.open() => LookupError: (osx)

2017-05-10 Thread Anthony Sottile
New submission from Anthony Sottile: Originally seen here: https://github.com/Microsoft/vscode/issues/26227 ``` $ LC_ALL=en_US python -c 'import io; io.open("/dev/null")' Traceback (most recent call last): File "", line 1, in LookupError: unknown encoding:

[issue35802] os.stat / os.lstat always present, but code checks hastattr(os, 'stat') / hasattr(os, 'lstat')

2019-02-25 Thread Anthony Sottile
Change by Anthony Sottile : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35802> ___ ___ Pyth

[issue36130] Pdb(skip=[...]) + module without __name__ => TypeError

2019-02-26 Thread Anthony Sottile
New submission from Anthony Sottile : Here's the simplest example I could come up with -- hit this while debugging pytest (which uses attrs which uses similar code to this to make classes) import pdb; pdb.Pdb(skip=['django.*']).set_trace() eval(compile("1", &

[issue36130] Pdb(skip=[...]) + module without __name__ => TypeError

2019-02-26 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +12088 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36130> ___ _

[issue33944] Deprecate and remove pth files

2019-02-28 Thread Anthony Sottile
Anthony Sottile added the comment: > contain features we all want to get rid of I don't think even this is unanimous. Things like registering codecs, instrumenting coverage in subprocesses, etc. all seem like legitimate uses of the arbitrary code execution

[issue33944] Deprecate and remove pth files

2019-02-28 Thread Anthony Sottile
Anthony Sottile added the comment: > What I think Anthony is looking for are ways to register “start up functions” > that get executed automatically when the Python interpreter starts up yes, this is what I want to still exist :) my hope is that there's a clear standards-track

[issue33944] Deprecate and remove pth files

2019-03-01 Thread Anthony Sottile
Anthony Sottile added the comment: I don't have time to look through the data today but I wrote a script to collect the usages of `.pth` from pypi. I realized after I ran it that I skipped source distributions with `.zip` extension but otherwise it's pretty complete: https://

[issue36171] tkinter scrollbar missing 'state' option

2019-03-03 Thread Anthony Zeeman
New submission from Anthony Zeeman : The scrollbars in both tkinter and Tkinter don't have the 'state' option and cannot be disabled. -- components: Tkinter messages: 337041 nosy: azeeman priority: normal severity: normal status: open title: tkinter scrollbar missing

[issue36171] tkinter scrollbar missing 'state' option

2019-03-03 Thread Anthony Zeeman
Anthony Zeeman added the comment: Cheryl, here is the option listing from the ttk scrollbar configure method: TTK Scrollbar options: {'command': ('command', 'command', 'Command', '', '140274415153928offsetChanged'), 'orient

[issue36171] tkinter scrollbar missing 'state' option

2019-03-03 Thread Anthony Zeeman
Anthony Zeeman added the comment: Cheryl, thank you for your help. On Sunday, March 3, 2019, 7:02:47 p.m. EST, Cheryl Sabella wrote: Cheryl Sabella added the comment: That's because state isn't an option.  :-) I should have included the link to the ttk scrollbar manp

[issue33944] Deprecate and remove pth files

2019-03-06 Thread Anthony Sottile
Anthony Sottile added the comment: I did my best to classify those on pypi that were using `.pth` files. My initial search had quite a few false positives (and now that I look at it, completely missed `.zip`-based source distributions so there's likely some false negatives as well) H

[issue33944] Deprecate and remove pth files

2019-03-06 Thread Anthony Sottile
Anthony Sottile added the comment: > > There was a single .pth file that I deemed "malicious" since it completely breaks the `subprocess` module (`subprocess-run`) > > It only seems to set an attribute. What's wrong with that? Does the early import of subprocess

[issue33944] Deprecate and remove pth files

2019-03-06 Thread Anthony Sottile
Anthony Sottile added the comment: > Doesn’t that kind of prove my point? :) It's not any worse than gevent ~breaking~ monkeypatching almost the entire standard library. And to be fair to the author, it was created well before (2013-06-21) python3.5's `run` api existed (2015

[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile
Anthony Sottile added the comment: I think nearly all of the use cases in the packages are valid (except module-layout) -- or at least if this feature were removed without having a startup-time site-packages code execution feature there would be no possible replacement. I'll elabor

[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile
Anthony Sottile added the comment: > What I'm dismissing is that "pip install some-package" can define a global > startup task for your interpreter. I shouldn't get debugging or code coverage > enabled every time I run "python" just because I installed

[issue33944] Deprecate and remove pth files

2019-03-07 Thread Anthony Sottile
Anthony Sottile added the comment: >>> I should have to start that package somehow. >> >> `pip install` is a pretty good opt-in already imo > > Except that it conflates responsibilities. I may not want to opt into > coverage even being loaded in my application b

[issue36264] os.path.expanduser should not use HOME on windows

2019-03-11 Thread Anthony Sottile
New submission from Anthony Sottile : The current code for `os.path.expanduser` in `ntpath` uses `HOME` in preference to `USERPROFILE` / `HOMEDRIVE\\HOMEPATH` I can't find any documentation of `HOME` being relevant on windows (only on posix). For example, wikipedia only men

[issue36264] os.path.expanduser should not use HOME on windows

2019-03-11 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +12262 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36264> ___ _

[issue36264] os.path.expanduser should not use HOME on windows

2019-03-12 Thread Anthony Sottile
Anthony Sottile added the comment: > Modifying this value could have a real impact on the rest of the process, so > we should be very careful to undo it regardless of test result. (Modifying > HOME is not a as big a deal since, as you point out, it's not "real" ;) )

[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-20 Thread anthony shaw
New submission from anthony shaw : If for whatever reason, Py_Initialize() has not been run or failed to run, any call to Py_CompileStringFlags will call PyUnicode_DecodeFSDefault and the reference to interp will be NULL. There is currently no null reference check in

[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw
anthony shaw added the comment: This applies to PyUnicode_EncodeFSDefault as well, it has the same issue -- ___ Python tracker <https://bugs.python.org/issue36

[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw
anthony shaw added the comment: I'm expecting a "this is not a bug, why would the interpreter not be initialized", but it would be nice to get a friendly error message since this is a public API. IF so, am also happy to submit

[issue36386] segfault on PyUnicode_DecodeFSDefaultAndSize for uninitialized Py

2019-03-21 Thread anthony shaw
anthony shaw added the comment: This is because PyUnicode_DecodeFSDefaultAndSize calls _PyInterpreterState_GET_UNSAFE(), which already documents the potential NULL return value. /* Get the current interpreter state. The macro is unsafe: it does not check for error and it can return

[issue36420] f_trace_opcodes setting and accessing opcodes

2019-03-24 Thread anthony shaw
New submission from anthony shaw : The f_trace_opcodes flag for sys.settrace in 3.7 are proving tricky. I must be missing something but it's not clear how it helps in tracing the opcode about to be executed because it runs before opcode and oparg variables are set by NEXTOPARG(), s

[issue36420] f_trace_opcodes setting and accessing opcodes

2019-03-24 Thread anthony shaw
Change by anthony shaw : -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue36420> ___ ___

[issue36420] f_trace_opcodes setting and accessing opcodes

2019-03-24 Thread anthony shaw
anthony shaw added the comment: Took a while, but I worked out a solution: import sys import dis import traceback import io def t(frame, event, args): frame.f_trace_opcodes=True stack = traceback.extract_stack(frame) pad = " "*len(stack) + "|" if event ==

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-03-29 Thread Anthony Sottile
New submission from Anthony Sottile : While building python 3.5.7 for https://github.com/deadsnakes ../Modules/_pickle.c: In function 'PyMemoTable_Copy': ../Modules/_pickle.c:677:5: error: 'for' loop initial declarations are only allowed in C99 mode for (si

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-03-29 Thread Anthony Sottile
Change by Anthony Sottile : -- keywords: +patch pull_requests: +12556 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36478> ___ _

[issue36500] Add "regen-*" equivalent projects for Windows builds

2019-04-01 Thread anthony shaw
New submission from anthony shaw : Now that pgen is written in Python, it'd be useful for Windows users to be able to rebuild grammar and tokens into the parser table. The current hook (make regen-grammar) is built into the Makefile. Add support for VS2017+ vcxproj files to call the s

[issue36500] Add "regen-*" equivalent projects for Windows builds

2019-04-01 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +12583 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36500> ___ ___ Py

[issue36500] Add "regen-*" equivalent projects for Windows builds

2019-04-01 Thread anthony shaw
Change by anthony shaw : -- nosy: +brett.cannon, steve.dower ___ Python tracker <https://bugs.python.org/issue36500> ___ ___ Python-bugs-list mailing list Unsub

[issue36500] Add "regen-*" equivalent projects for Windows builds

2019-04-01 Thread anthony shaw
anthony shaw added the comment: Project now also does: regen-symbol (regenerate Lib/symbol.py) and regen-keyword (regenerate Lib/keyword.py) -- ___ Python tracker <https://bugs.python.org/issue36

[issue36500] Add "regen-*" equivalent projects for Windows builds

2019-04-01 Thread anthony shaw
Change by anthony shaw : -- nosy: +pablogsal ___ Python tracker <https://bugs.python.org/issue36500> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue2180] tokenize: mishandles line joining

2019-04-07 Thread Anthony Sottile
Anthony Sottile added the comment: Here's an example in the wild which still reproduces with python3.8a3: https://github.com/SecureAuthCorp/impacket/blob/194b22ed2fc85c4f241375fb7ebe4e0d89626c8c/impacket/examples/remcomsvc.py#L1669 This was reported as a bug on flake8: https://gitla

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-07 Thread anthony shaw
New submission from anthony shaw : List comprehensions currently create a series of opcodes inside a code object, the first of which is BUILD_LIST with an oparg of 0, effectively creating a zero-length list with a preallocated size of 0. If you're doing a simple list comprehension

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-07 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +12644 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36551> ___ ___ Py

[issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX

2019-04-07 Thread anthony shaw
New submission from anthony shaw : When calculating length of range() objects that have an r->length > PY_SIZE_MAX, the underlying PyLong_AsSsize_t() function will raise an OverflowError: >>> a = list(range(2**256)) Traceback (most recent call last): File "",

[issue36552] Replace OverflowError with ValueError when calculating length of range objects > PY_SIZE_MAX

2019-04-07 Thread anthony shaw
Change by anthony shaw : -- keywords: +patch pull_requests: +12646 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue36552> ___ ___ Py

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-07 Thread anthony shaw
Change by anthony shaw : -- type: -> enhancement ___ Python tracker <https://bugs.python.org/issue36551> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: The opcode would not solely apply to this specific use case. I could seek another way of implementing the same behaviour without an additional opcode? -- ___ Python tracker <https://bugs.python.org/issue36

[issue35488] pathlib Path.match does not behave as described

2019-04-08 Thread anthony shaw
Change by anthony shaw : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > How about converting `[x for x in it]` to `[*it]` in AST? I should have been more explicit, this patch improves the performance of all list comprehensions that don’t have an if clause. Not just [x for x in y] but: d = {} # some sort of dictionary [f

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > This might cause a MemoryError when the __length_hint__ of the source returns > a too large value, even when the actual size of the comprehension is smaller, > e.g.: The current implementation of list comprehensions raise neither a memoryerror or

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > This patch makes it slow for small iterators That is a one-off cost for the __length_hint__ of the range object specifically. Objects with a known length (lists, sets, tuples) would not have that overhead. I can run a more useful set of benchmarks agai

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > In such case, current behavior works. And your patch will raise > OverflowError. Try [x for x in range(2**1000)] in a REPL. It doesn’t raise anything, it tries to create a list that will eventually exceed PY_SIZE_MAX, but it only crashes once it r

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. iterator will return 2**1000 for __length_hint__, but produce no item on iteration. It raises an OverflowError because of the goto https://github.com/python/cpython/pull/12718/files#d

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: > If your patch uses __length_hint__, it is bug. I’m not sure I understand this comment, PEP424 says “This is useful for presizing containers when building from an iterable.“ This patch uses __length_hint__ to presize the list container for a l

[issue36478] backport of pickle fixes to Python 3.5.7 uses C99 for loops

2019-04-08 Thread Anthony Sottile
Anthony Sottile added the comment: It's a rather oldish gcc in this case. (4.8.4 + whatever ubuntu patches). Here's a full (successful) build log (including the combinations of flags) after patching: https://launchpadlibrarian.net/416985438/buildlog_ubuntu-trusty-amd64.python3

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-08 Thread anthony shaw
anthony shaw added the comment: Have just optimized some of the code and pushed another change as 69dce1c552. ran both master and 69dce1c552 using pyperformance with PGO: ➜ ~ python3.8 -m perf compare_to master.json 69dce1c552.json --table

[issue36551] Optimize list comprehensions with preallocate size and protect against overflow

2019-04-09 Thread anthony shaw
anthony shaw added the comment: >I am -1 for this optimization because it affects only one particular case >(neither other kinds of comprehensions, nor generator expressions, nor list >comprehensions with conditions) and even in this case it is small. It is possible to add a lot

[issue34850] Emit a syntax warning for "is" with a literal

2019-04-13 Thread Anthony Sottile
Anthony Sottile added the comment: Should this also produce warnings for `list` / `dict` / `set` literals? ``` $ python3.8 Python 3.8.0a3 (default, Mar 27 2019, 03:46:44) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more

[issue36782] Add tests for the datetime C API

2019-05-04 Thread anthony shaw
anthony shaw added the comment: Reserving this issue (in mentored sprint) -- nosy: +anthony shaw ___ Python tracker <https://bugs.python.org/issue36782> ___ ___

[issue36782] Add tests for the datetime C API

2019-05-04 Thread anthony shaw
Change by anthony shaw : -- nosy: +edison.abahurire ___ Python tracker <https://bugs.python.org/issue36782> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35534] SIGSEGV in stackdepth_walk

2019-05-06 Thread anthony shaw
anthony shaw added the comment: stackdepth_walk no longer exists in Python 3, this is a 2.7 specific issue. opcode_stack_effect in compile.c will have the expected stack effect. If there is a mismatch between the Opcodes compiled with the distribution and the ones in the compile.c

[issue34214] Pylint recusion stack overflow abort

2019-05-06 Thread anthony shaw
anthony shaw added the comment: I agree with Jerome, that handling recursion errors is a part of a 3rd party package and not a bug with CPython. -- nosy: +anthony shaw ___ Python tracker <https://bugs.python.org/issue34

[issue31372] Add SSLSocket.get_verify_result()

2019-05-06 Thread anthony shaw
anthony shaw added the comment: Please review the PR again, some of the code no longer applies as it targets master and the PR is quite old. -- nosy: +anthony shaw ___ Python tracker <https://bugs.python.org/issue31

[issue32430] Simplify Modules/Setup{,.dist,.local}

2019-05-06 Thread anthony shaw
anthony shaw added the comment: PR GH-5062 is still open in GitHub, is this PR still required? -- nosy: +anthony shaw ___ Python tracker <https://bugs.python.org/issue32

[issue31841] Several methods of collections.UserString do not return instances of UserString or its subclasses

2019-05-06 Thread anthony shaw
anthony shaw added the comment: This issue has been open for some time and the PR references an upstream branch that no longer exists. Can this request be closed, or has the conversation yet to be resolved? -- nosy: +anthony shaw ___ Python

[issue15987] Provide a way to compare AST nodes for equality recursively

2019-05-06 Thread anthony shaw
anthony shaw added the comment: This discussion is inconclusive and targets an old version of CPython, can this issue be closed? -- nosy: +anthony shaw ___ Python tracker <https://bugs.python.org/issue15

[issue15987] Provide a way to compare AST nodes for equality recursively

2019-05-06 Thread anthony shaw
anthony shaw added the comment: Closing issue, PR branch has since been removed and targets Python 3.4 -- nosy: +anthonypjshaw resolution: -> out of date stage: test needed -> resolved status: open -> closed ___ Python tracke

[issue24263] unittest cannot load module whose name starts with Unicode

2019-05-06 Thread anthony shaw
anthony shaw added the comment: The original PR refers to a branch that no longer exists, but the behaviour documented still applies to master. There were some changes to the test loader, but none that fixed this issue. -- nosy: +anthonypjshaw

[issue34820] binascii.c:1578:1: error: the control flow of function ‘binascii_crc32’ does not match its profile data (counter ‘arcs’)

2019-05-06 Thread anthony shaw
anthony shaw added the comment: There is not enough information to triage this issue and since the last request there has been no reply. Closing issue. -- nosy: +anthonypjshaw stage: -> resolved status: open -> closed ___ Python tracker

[issue31813] python -m ensurepip hangs

2019-05-06 Thread anthony shaw
anthony shaw added the comment: I believe the issue is caused by the issue referenced in the last comment. Closing issue -- nosy: +anthonypjshaw resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracke

[issue5243] Missing dependency in distutils build

2019-05-06 Thread anthony shaw
anthony shaw added the comment: This issue has been open for some time, looking at the install_lib in master, there have been no changes to call 'build_clib' so the issue documented here would still apply. -- nosy: +anthonypjshaw

[issue26303] Shared execution context between doctests in a module

2019-05-06 Thread anthony shaw
anthony shaw added the comment: this issue would be good for pycon sprints -- nosy: +Mariatta, anthonypjshaw ___ Python tracker <https://bugs.python.org/issue26

[issue26303] Shared execution context between doctests in a module

2019-05-06 Thread anthony shaw
Change by anthony shaw : -- assignee: docs@python -> Mariatta ___ Python tracker <https://bugs.python.org/issue26303> ___ ___ Python-bugs-list mailing list Un

[issue28540] math.degrees(sys.float_info.max) should throw an OverflowError exception

2019-05-06 Thread anthony shaw
anthony shaw added the comment: Francisco, I recommend converting the patch into a GitHub pull request to make it easier to code review. Mark, Raymond, please could you re-review this patch. -- nosy: +anthonypjshaw, rhettinger ___ Python tracker

<    1   2   3   4   5   6   7   8   >