[issue46078] `ast.unparse` fails on `class C: i: int`… convert broken from `ast.AnnAssign` to `ast.Assign`

2021-12-14 Thread Samuel Marks
Samuel Marks added the comment: Just fixed the issue by using this value: ```py "```(None)```" if sys.version_info[:2] >= (3, 9) else "```None```" ``` -- stage: -> resolved status: open -> closed ___ Python trac

[issue46078] `ast.unparse` fails on `class C: i: int`… convert broken from `ast.AnnAssign` to `ast.Assign`

2021-12-14 Thread Samuel Marks
New submission from Samuel Marks : astor fails with: ``` File "python3.8/site-packages/astor/code_gen.py", line 63, in to_source generator.visit(node) File "python3.8/site-packages/astor/node_util.py", line 143, in visit return visitor(node) File "pyth

[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks
Samuel Marks added the comment: Fixed with https://github.com/offscale/cdd-python/commit/079dc28 -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/i

[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks
Samuel Marks added the comment: Hmm, debugging my test and I was able to replicate it with this smaller one: ``` from ast import FunctionDef, arguments, Load, Name, AnnAssign, Store, BinOp, Add, unparse unparse(FunctionDef(args=arguments(args=[], defaults

[issue44825] node.annotation is not a str in `ast`'s `class _Unparser(NodeVisitor)`

2021-08-04 Thread Samuel Marks
New submission from Samuel Marks : I tried making `node.annotation` an `ast.Name("str", ast.Load())`, which worked but when the AST was unparsed to a string it shows as `# type: `. https://github.com/offscale/cdd-python/runs/3213864077 Replicate with: ``` unparse(Assign(annot

[issue44470] 3.11 docs.python.org in Polish not English?

2021-06-24 Thread Samuel Marks
Samuel Marks added the comment: Yep exactly like my screenshot but now the Polish has turned Korean… my family was never Korean! -- ___ Python tracker <https://bugs.python.org/issue44

[issue44470] 3.11 docs.python.org in Polish not English?

2021-06-21 Thread Samuel Marks
New submission from Samuel Marks : It's been too long since my family have been Polish! (see screenshot of https://docs.python.org/3.11/library/parser.html ) My computer is only configured for English. Running Firefox 90.0b9 (64-bit) on macOS 11.4 (20F71). -- assignee: docs@python

[issue44402] Python 3.9 and 3.10 fails to install in WINE

2021-06-11 Thread Samuel Marks
New submission from Samuel Marks : What works: - python-3.7.9.exe python-3.8.9.exe What fails: - python-3.10.0b2.exe python-3.9.5.exe (I'm debugging some regressions on my test suite… macOS and Linux [incl. in Docker] work, Windows fails) How to reproduce (macOS): 0. Install WINE

[issue44321] os.EX_OK for Windows

2021-06-06 Thread Samuel Marks
Samuel Marks added the comment: `EXIT_SUCCESS` is defined in `stdlib.h`, as per https://docs.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure (following the standard https://pubs.opengroup.org/onlinepubs/009695399/basedefs/stdlib.h.html) There are also https

[issue44321] os.EX_OK for Windows

2021-06-06 Thread Samuel Marks
Change by Samuel Marks : -- keywords: +patch pull_requests: +25147 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26559 ___ Python tracker <https://bugs.python.org/issu

[issue44321] os.EX_OK for Windows

2021-06-06 Thread Samuel Marks
New submission from Samuel Marks : Since Python 2.3 alpha 2 [19-Feb-2003] `EX_OK` has existed… but only for Unix. This adds support for Windows. -- components: Windows messages: 395203 nosy: paul.moore, samuelmarks, steve.dower, tim.golden, zach.ware priority: normal severity: normal

[issue43339] Could not build the ssl module! | macOS with `CPPFLAGS` and `LDFLAGS` set

2021-02-27 Thread Samuel Marks
Samuel Marks added the comment: Nevermind it actually was that missing `PKG_CONFIG_PATH` line… -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue43339] Could not build the ssl module! | macOS with `CPPFLAGS` and `LDFLAGS` set

2021-02-27 Thread Samuel Marks
New submission from Samuel Marks : I was on 3.10a4 on macOS 11.1 for ages, finally decided to upgrade to a5, building from source. With latest `brew install openssl zlib`. ``` $ export LDFLAGS='-L/usr/local/opt/openssl@1.1/lib -L/usr/local/opt/zlib/lib' $ export CPPFLAGS='-I/usr/local/opt

[issue43203] Default value incorrectly read with unittests on Windows & macOS but not Linux

2021-02-11 Thread Samuel Marks
New submission from Samuel Marks : Had a couple of commits to try and fix it on GitHub Actions (as I was unable to replicate locally), ended up with this very easy fix for Windows: https://github.com/SamuelMarks/doctrans/commit/98203e9fee3e0a888ab1f4128011dde5fad98f63 To completely remove

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Samuel Marks
Samuel Marks added the comment: There were only 12k occurrences, I'm sure I could manually go through that in an afternoon. Would you accept it then? On Tue, 22 Dec 2020, 12:22 am Eric V. Smith, wrote: > > Eric V. Smith added the comment: > > See https://github.com/ikamensh/f

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Samuel Marks
Samuel Marks added the comment: EDIT: Just found https://github.com/ikamensh/flynt -- ___ Python tracker <https://bugs.python.org/issue42699> ___ ___ Python-bug

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Samuel Marks
Samuel Marks added the comment: I suppose that's a good justification to never improve/upgrade the syntax and quality of the codebase. In terms of automatic upgrades of the codebase, one could always replicate the approach I use in doctrans—i.e., use of `ast` and/or `inspect

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Samuel Marks
Samuel Marks added the comment: Wait I don't understand why you wouldn't accept a wholesale replacement of all `%` and `format` with f-strings through the entire CPython codebase [master branch]? BTW: Kinda unrelated, but would be great to have perspective on this little project - https

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-21 Thread Samuel Marks
Samuel Marks added the comment: Yeah I hear ya, was just trying for the most concise issue title. I tend to [over]use `map`, `filter`, `filterfalse` and other `itertools` and `operator` methods in my own codebase. Surprised with that result, that using an explicit list is actually faster

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Samuel Marks
Samuel Marks added the comment: @eric.smith No benchmarks offhand, but I'd expect it to be a very minor improvement (if detectable). If this gets accepted I'll probably do a bunch of little changes like this, to improve things, e.g., replace '%' with '.format' (or f-strings, whatever you

[issue42699] Use `.join(k for k in g)` instead of `.join([k for k in g])`

2020-12-20 Thread Samuel Marks
New submission from Samuel Marks : This is an extremely minor improvement. Rather than create a `list`—using a comprehension—then have it consumed by `.join`, one can skip the list construction entirely. (I remember this working from at least Python 2.7… probably earlier also

[issue41810] Consider reintroducing `types.EllipsisType` for the sake of typing

2020-11-05 Thread Samuel Marks
Samuel Marks added the comment: Since we're bringing these back, would you accept a backport of these types? [I'm writing a bunch of parsers/emitters—and starting to maintain an old runtime type-checker—for 3.6+] -- nosy: +samuelmarks ___ Python

[issue42242] Backport SQLite trace API v2

2020-11-02 Thread Samuel Marks
Samuel Marks added the comment: Done, thanks for the how-to: - https://github.com/python/cpython/pull/23103 [3.8] - https://github.com/python/cpython/pull/23102 [3.9] -- ___ Python tracker <https://bugs.python.org/issue42

[issue40318] Migrate to SQLite3 trace v2 API

2020-11-02 Thread Samuel Marks
Change by Samuel Marks : -- pull_requests: +22020 pull_request: https://github.com/python/cpython/pull/23103 ___ Python tracker <https://bugs.python.org/issue40

[issue40318] Migrate to SQLite3 trace v2 API

2020-11-02 Thread Samuel Marks
Change by Samuel Marks : -- nosy: +samuelmarks nosy_count: 4.0 -> 5.0 pull_requests: +22019 pull_request: https://github.com/python/cpython/pull/23102 ___ Python tracker <https://bugs.python.org/issu

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
Samuel Marks added the comment: Opened two issues and two PRs for 3.8 and 3.8: - https://bugs.python.org/issue42241 - https://bugs.python.org/issue42242 -- ___ Python tracker <https://bugs.python.org/issue42

[issue42242] Backport SQLite trace API v2

2020-11-01 Thread Samuel Marks
New submission from Samuel Marks : Backports https://github.com/python/cpython/pull/19581 https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229 See also 3.9 backporting: https://bugs.python.org/issue42241 [not sure if this is how you do backporting, a new issue and GH

[issue42241] Backport SQLite trace API v2

2020-11-01 Thread Samuel Marks
New submission from Samuel Marks : Backports https://github.com/python/cpython/pull/19581 https://bugs.python.org/issue40318 as per https://bugs.python.org/issue42229 -- components: Build messages: 380185 nosy: samuelmarks priority: normal pull_requests: 22011 severity: normal status

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
Change by Samuel Marks : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue42229> ___ ___ Python-bugs-list

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
Samuel Marks added the comment:  -- ___ Python tracker <https://bugs.python.org/issue42229> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
Samuel Marks added the comment: @erlendaasland Hmm… just double-checked, and this issue is present on Python 3.8.6 and 3.9.0 but not master [d3b4e068077dd26927ae7485bd0303e09d962c02] as you referenced. Should I close this issue—and PR—then? - Backport from master

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
Samuel Marks added the comment: Yes, this commit extends his changes to include macOS support (for some reason that SQLite version check doesn’t work properly on macOS; so this checks the macOS version, knowing AOT when SQLite trace v1 APIs were deprecated. Curious

[issue42229] Fix SQLite warnings on macOS

2020-11-01 Thread Samuel Marks
New submission from Samuel Marks : Planned to fix all the compiler warnings on macOS. Ended up just fixing this SQLite one: ``` Python-3.9.0/Modules/_sqlite/connection.c:1066:9: warning: 'sqlite3_trace' is deprecated: first deprecated in macOS 10.12 [-Wdeprecated-declarations

[issue41819] Fix some compiler warnings

2020-09-20 Thread Samuel Marks
Change by Samuel Marks : -- keywords: +patch pull_requests: +21376 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22332 ___ Python tracker <https://bugs.python.org/issu

[issue41819] Fix some compiler warnings

2020-09-20 Thread Samuel Marks
Samuel Marks added the comment: Okay I'll redo it on master, here is my config, on macOS 10.15.6: ``` $ export PKG_CONFIG_PATH="/usr/local/opt/openssl@1.1/lib/pkgconfig" $ export CPPFLAGS="-I/usr/local/opt/openssl@1.1/include" $ export LDFLAGS="-L/usr/local/opt/

[issue41819] Fix some compiler warnings

2020-09-20 Thread Samuel Marks
New submission from Samuel Marks : https://github.com/SamuelMarks/cpython/tree/3.9-compiler-fixes -- components: Build messages: 377205 nosy: samuelmarks priority: normal pull_requests: 21373 severity: normal status: open title: Fix some compiler warnings type: compile error versions

[issue22240] argparse support for "python -m module" in help

2019-10-04 Thread Samuel Marks
Samuel Marks added the comment: See https://bugs.python.org/msg353987 for manual test -- Added file: https://bugs.python.org/file48643/prog-module-name-handler.patch ___ Python tracker <https://bugs.python.org/issue22

[issue22240] argparse support for "python -m module" in help

2019-10-04 Thread Samuel Marks
Samuel Marks added the comment: Until this is accepted, I've modified my codebase: ``` from argparse import ArgumentParser ArgumentParser( prog=None if globals().get('__spec__') is None else 'python -m {}'.format(__spec__.name.partition('.')[0]) ) ``` -- nosy: +samuelmarks

[issue21014] `1` = `True`; for tutorial docs

2014-03-21 Thread Samuel Marks
New submission from Samuel Marks: Particularly for new programmers `True` makes more sense than `1` when doing boolean logic. If you aren't going to accept this patch; at least add in a sentence explaining that: ` 1 == True`. Best, Samuel Marks -- assignee: docs@python components