[issue44737] Mapping from to collections.abc
New submission from Du <491609...@qq.com>: When using Sanic, referencing Mapping in collections in SANic-Jinja2 brings ImportError: Cannot import name 'Mapping' from 'collections'. When you use Mapping, shouldn't you call from collections.abc? -- messages: 398208 nosy: haitanghuadeng priority: normal severity: normal status: open title: Mapping from to collections.abc type: resource usage versions: Python 3.10 ___ Python tracker <https://bugs.python.org/issue44737> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue45275] Make argparse print description of subcommand when invoke help doc on subcommand
New submission from Chuanlong Du : I have command-line script `blog` written using argparse. It supports subcommands. When I check the help doc of a subcommand, e.g., using `blog convert -h`, it prints the help doc of the subcommand `blog convert` but doesn't print the description of the subcommand `blog convert`. A screenshot is attached. It is quite often that I know a command-line application have certain subcommands but I forget exactly what they do. It would be very helpful if `blog subcmd -h` prints the description of the subcmd so that users do not have to call `blog -h` again to check exactly what the subcommand does. -- components: Library (Lib) files: Selection_011.png messages: 402541 nosy: longendu priority: normal severity: normal status: open title: Make argparse print description of subcommand when invoke help doc on subcommand type: enhancement versions: Python 3.10, Python 3.11, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file50301/Selection_011.png ___ Python tracker <https://bugs.python.org/issue45275> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39864] IndexError gives wrong axis info
New submission from Ningyi Du : IndexError: index 11 is out of bounds for axis 0 with size 11 The actual error is not with axis 0, but axis 3. error message: 168 if iJ>=9: 169 print(iE,iE0,iEtemp,iJ,li,lf,mlf+lf) --> 170 SS[iEtemp][iJ][li][lf][mlf+lf]= FF(jf,mf,lf,mlf,ji,mi,li,J)*SJ[iCh][jCh] 171 172 sumSJ1 += np.abs(SJ0[iCh][jCh])**2 IndexError: index 11 is out of bounds for axis 0 with size 11 -- messages: 363433 nosy: ningyidu priority: normal severity: normal status: open title: IndexError gives wrong axis info ___ Python tracker <https://bugs.python.org/issue39864> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39864] IndexError gives wrong axis info
Ningyi Du added the comment: This is a simple test: test=np.zeros((2,3,4)) print(test[1][3][1]) IndexErrorTraceback (most recent call last) in 1 test=np.zeros((2,3,4)) > 2 print(test[1][3][1]) IndexError: index 3 is out of bounds for axis 0 with size 3 -- nosy: -xtreak ___ Python tracker <https://bugs.python.org/issue39864> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39864] IndexError gives wrong axis info
Ningyi Du added the comment: I believe it's a bug. The axis 0 is misleading. However, it is a problem for numpy developers. Thank you for your time. On Thu, Mar 5, 2020, 10:42 AM Peter Otten wrote: > > Peter Otten <__pete...@web.de> added the comment: > > This is not a bug (and if it were you would have to report to numpy, not > cpython). > > Consider: > > >>> import numpy > >>> a = numpy.zeros((2,2,2)) > >>> a[0,2] > Traceback (most recent call last): > File "", line 1, in > IndexError: index 2 is out of bounds for axis 1 with size 2 > > This is probably the message you expect. However, if you write > >>> a[0][2] > Traceback (most recent call last): > File "", line 1, in > IndexError: index 2 is out of bounds for axis 0 with size 2 > > you split the operation into two steps, and the second axis of a is > effectively the first axis of a[0]. > > -- > nosy: +peter.otten -steven.daprano > > ___ > Python tracker > <https://bugs.python.org/issue39864> > ___ > -- title: IndexError gives wrong axis info -> IndexError gives wrong axis info ___ Python tracker <https://bugs.python.org/issue39864> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue40973] platform.platform() in Python 3.8 does not report detailed Linux platform information
New submission from Ben Du : The function platform.platform() does not report detailed Linux platform information (Ubuntu, Debain, CentOS, etc). This information is reported in Python 3.7 and earlier. -- components: Library (Lib) messages: 371488 nosy: legendu priority: normal severity: normal status: open title: platform.platform() in Python 3.8 does not report detailed Linux platform information type: behavior versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue40973> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33129] Add kwarg-only option to dataclass
New submission from Alan Du : I'd like to request a new option to the `dataclasses.dataclass` decorator to make the `__init__` keyword-only. The two use-cases I have in mind are: (1) Using as a dataclass big-bag-of-config. In this scenario, forcing the user to specify the keywords is a lot nicer than passing in a dozen positional parameters. (2) Having kwarg-only parameters means that inheritance and default parameters play nicely with each other again instead of raising a TypeError. -- components: Library (Lib) messages: 314341 nosy: alan_du, eric.smith priority: normal severity: normal status: open title: Add kwarg-only option to dataclass type: enhancement versions: Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33129] Add kwarg-only option to dataclass
Alan Du added the comment: If this would be accepted, I'd be happy to contribute a patch adding a `kwarg_only` option to `dataclass` (although it might take me a while since I'm not super familiar with the Python development workflow). I believe I already have the code change necessary at https://github.com/alanhdu/cpython/commit/fa35b39e5204845690ff774812f882f40b0e5f90 (although it still needs tests and documentation). -- ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33129] Add kwarg-only option to dataclass
Alan Du added the comment: Err... the right link would actually be https://github.com/alanhdu/cpython/tree/bpo-33129. -- ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue33129] Add kwarg-only option to dataclass
Change by Alan Du : -- keywords: +patch pull_requests: +5975 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue33129> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32167] "Improve" random.choice function for FiFa purpose
Change by Du Phan : -- components: Build nosy: duphan priority: normal severity: normal status: open title: "Improve" random.choice function for FiFa purpose type: behavior versions: Python 2.7 ___ Python tracker <https://bugs.python.org/issue32167> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32167] Improve random.choice function for FiFa purpose
Change by Du Phan : -- title: "Improve" random.choice function for FiFa purpose -> Improve random.choice function for FiFa purpose ___ Python tracker <https://bugs.python.org/issue32167> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32167] Improve random.choice function for FiFa purpose
Change by Du Phan : -- stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue32167> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue19576] "Non-Python created threads" documentation doesn't mention PyEval_InitThreads()
Jiong Du added the comment: this patch made a new issue<20891> -- nosy: +lolynx ___ Python tracker <http://bugs.python.org/issue19576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31743] Proportional Width Font on Generated Python Docs PDFs
Paul Du Bois added the comment: For what it's worth, I also see proportional-width fonts when looking at the docs in Android Chrome. For example, the binary tree in https://docs.python.org/3/library/heapq.html is mangled. -- nosy: +paul.dubois ___ Python tracker <https://bugs.python.org/issue31743> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31743] Proportional Width Font on Generated Python Docs PDFs and in mobile browser
Change by Paul Du Bois : -- title: Proportional Width Font on Generated Python Docs PDFs -> Proportional Width Font on Generated Python Docs PDFs and in mobile browser ___ Python tracker <https://bugs.python.org/issue31743> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6570] Documentation Clarity
New submission from Mark du Preez : Hi In section 4.7.2 of the tutorial documentation, we suddenly find the following paragraph: "In general, an argument list must have any positional arguments followed by any keyword arguments, where the keywords must be chosen from the formal parameter names. It’s not important whether a formal parameter has a default value or not. No argument may receive a value more than once — formal parameter names corresponding to positional arguments cannot be used as keywords in the same calls. Here’s an example that fails due to this restriction:" To a beginner who is reading a tutorial to learn how to use this language for the first time, it is completely overwhelming. What is a "positional argument" vs a "keyword argument" and what is a "formal parameter name"? None of these things have been explained up until this point and an understanding of their meaning is required to make sense of this paragraph. Please consider revising this section. Thank you. Mark -- assignee: georg.brandl components: Documentation messages: 90910 nosy: StMark, georg.brandl severity: normal status: open title: Documentation Clarity type: feature request versions: Python 3.1 ___ Python tracker <http://bugs.python.org/issue6570> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com