[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue39487> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17631 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18254 ___ Python tracker <https://bugs.python.org/issu

[issue39487] Merge duplicated _Py_IDENTIFIER identifiers in C code

2020-01-29 Thread hai shi
New submission from hai shi : As stinner said in issue19514 those _Py_IDENTIFIER should be merged: ./Modules/_ctypes/_ctypes.c:1054:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1132:_Py_IDENTIFIER(_type_); ./Modules/_ctypes/_ctypes.c:1494:_Py_IDENTIFIER(_type_); ./Modules

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-19 Thread hai shi
Change by hai shi : -- pull_requests: +17457 pull_request: https://github.com/python/cpython/pull/18066 ___ Python tracker <https://bugs.python.org/issue1635

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-19 Thread hai shi
Change by hai shi : -- pull_requests: +17456 pull_request: https://github.com/python/cpython/pull/18065 ___ Python tracker <https://bugs.python.org/issue1635

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-18 Thread hai shi
Change by hai shi : -- pull_requests: +17445 pull_request: https://github.com/python/cpython/pull/18050 ___ Python tracker <https://bugs.python.org/issue1635

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-18 Thread hai shi
Change by hai shi : -- pull_requests: +17444 pull_request: https://github.com/python/cpython/pull/18049 ___ Python tracker <https://bugs.python.org/issue1635

[issue39173] _AttributeHolder of argparse should support the sort function or not?

2020-01-17 Thread hai shi
hai shi added the comment: paul said in issue 39058: `Anyways removing the sort makes sense, and the proposed change phrase "in the order attributes were added" is sufficiently general.` I agree paul's opinion now. The functionality meets users' needs now, so we don't need spend

[issue39378] partial of PickleState struct should be traversed.

2020-01-17 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17441 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18046 ___ Python tracker <https://bugs.python.org/issu

[issue39378] partial of PickleState struct should be traversed.

2020-01-17 Thread hai shi
New submission from hai shi : As subject, looks partial of PickleState struct should be traversed. -- components: Extension Modules messages: 360236 nosy: shihai1991 priority: normal severity: normal status: open title: partial of PickleState struct should be traversed. type

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-16 Thread hai shi
Change by hai shi : -- pull_requests: +17428 pull_request: https://github.com/python/cpython/pull/18032 ___ Python tracker <https://bugs.python.org/issue1635

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-16 Thread hai shi
Change by hai shi : -- pull_requests: +17425 pull_request: https://github.com/python/cpython/pull/18030 ___ Python tracker <https://bugs.python.org/issue1635

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-11 Thread hai shi
hai shi added the comment: FWIW, i counted the difference of each file's refs after `Py_Finalize()`. [('Objects/dictobject.c', 21434), ('Python/marshal.c', 8135), ('Objects/codeobject.c', 6245), ('Objects/listobject.c', 6037), ('Objects/tupleobject.c', 4169), ('Objects/boolobject.c', 2433

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-06 Thread hai shi
hai shi added the comment: Compare to _Py_ForgetReference(), _Py_INC_REFTOTAL in _Py_NewReference() looks redundant. REF: https://github.com/python/cpython/blob/master/Include/object.h#L442 master brach baseline in my vm: ``` sys.gettotalrefcount(): 18049 sys.gettotalrefcount(): 22463

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-06 Thread hai shi
Change by hai shi : -- pull_requests: +17299 pull_request: https://github.com/python/cpython/pull/17883 ___ Python tracker <https://bugs.python.org/issue1635

[issue39197] argparse: title and description for mutually exclusive arg groups

2020-01-05 Thread hai shi
hai shi added the comment: Do you have user case for it? _ArgumentGroup have the `title` attribute, so _MutuallyExclusiveGroup add same attribute is not a big probleam(if user really need it). -- nosy: +shihai1991 ___ Python tracker <ht

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-05 Thread hai shi
hai shi added the comment: One part of this issue is that all C extensions of the stdlib should be updated to implement the PEP 489 "Multi-phase extension module initialization". > I try to port _json extension module to multiphase initialization module, but > the baselin

[issue1635741] Py_Finalize() doesn't clear all Python objects at exit

2020-01-05 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +17262 stage: test needed -> patch review pull_request: https://github.com/python/cpython/pull/17835 ___ Python tracker <https://bugs.python.org/issue1

[issue16399] argparse: append action with default list adds to list instead of overriding

2020-01-02 Thread hai shi
hai shi added the comment: I update the doc of argparse and think this bpo could be closed when PR merged. -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue16

[issue39173] _AttributeHolder of argparse should support the sort function or not?

2020-01-02 Thread hai shi
hai shi added the comment: 1)>You'd need to elaborate on that. I've been using argparse for years and never once had presentational aspects affected by work. So, again, what is the actual use case for this? _AttributeHolder_ has sorted the args in `_get_kwargs()` and the offspring cl

[issue16399] argparse: append action with default list adds to list instead of overriding

2020-01-02 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue16399> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue16399] argparse: append action with default list adds to list instead of overriding

2020-01-01 Thread hai shi
Change by hai shi : -- pull_requests: +17226 stage: -> patch review pull_request: https://github.com/python/cpython/pull/17793 ___ Python tracker <https://bugs.python.org/issu

[issue39173] _AttributeHolder of argparse should support the sort function or not?

2019-12-31 Thread hai shi
hai shi added the comment: Users or developers interact with program by cli(argparse), so attributes' output order affect users' interaction. -- ___ Python tracker <https://bugs.python.org/issue39

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-31 Thread hai shi
hai shi added the comment: >Consider opening a separate issue (or start a thread on python-ideas) >about adding a more sophisticated implementation to the stdlib's >"reprlib" module. If you do so then please draw from the >argparse._AttributeHolder implementation. FWI

[issue39173] _AttributeHolder of argparse should support the sort function or not?

2019-12-31 Thread hai shi
New submission from hai shi : Currently, many developers discuss the output of attributes of argparse should be sorted or not? >>> from argparse import ArgumentParser >>> parser = ArgumentParser() >>> _ = parser.add_argument('outstream') >>> _ = pars

[issue39106] Add suggestions to argparse error message output for unrecognized arguments

2019-12-25 Thread hai shi
hai shi added the comment: I checked some other common clis and it is show all right available options too. So I thought the argparse's help function is good enough too ;) ``` $ ps -etest error: TTY could not be found Usage: ps [options] Try 'ps --help ' or 'ps --help ' for additional

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-22 Thread hai shi
hai shi added the comment: @Raymond OK, copy that. -- ___ Python tracker <https://bugs.python.org/issue39075> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue39075] types.SimpleNamespace should preserve attribute ordering (?)

2019-12-21 Thread hai shi
hai shi added the comment: IMHO, dropping the sort should be a default behavior. If some user need this feature, maybe we could supply a param to open the sort function or not? -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.

[issue38956] argparse.BooleanOptionalAction should not add the default value to the help string by default

2019-12-09 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue38956> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11354] argparse: nargs could accept range of options count

2019-11-14 Thread hai shi
hai shi added the comment: Could we close some bpo with a long history? If some user need this feature in future we could reopen it. -- ___ Python tracker <https://bugs.python.org/issue11

[issue11354] argparse: nargs could accept range of options count

2019-11-03 Thread hai shi
hai shi added the comment: I think the answer is 'yes'(It's over 8 years~). And tons of argparse'work need to be finished;) -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue11

[issue38618] Why not use refcount of c.c_filename in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
hai shi added the comment: Thanks for your patience, Serhiy. IMHO, i called the moving operation `clean code`: Consistent understanding, Consistent code. And the `clean code` should be a part of `enhancement`. -- ___ Python tracker <ht

[issue38618] Why not use refcount of c.c_filename in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
hai shi added the comment: > I don't understand the purpose of this issue. The bug tracker is not the > right place to ask question. If you think that it's a bug, please explain how > to trigger the bug. Hi, victor. What i want to express is that the refcount operation of filenam

[issue38617] Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject

2019-10-28 Thread hai shi
hai shi added the comment: Got it, thanks, Serhiy. -- ___ Python tracker <https://bugs.python.org/issue38617> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38618] Why not use refcount of c.c_filename in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
hai shi added the comment: Due to victor add the desc(`/* borrowed reference */`) so noisy+ victor ;) -- nosy: +vstinner ___ Python tracker <https://bugs.python.org/issue38

[issue38618] Why not use refcount of c.c_filename in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
New submission from hai shi : I don't know why don't use refcount ` /* borrowed reference */ c.c_filename = filename; ` in https://github.com/python/cpython/blob/master/Python/ast.c#L786-L787 like ` Py_INCREF(filename); c.c_filename = filename; ` in https://github.com/python/cpython/blob

[issue38617] Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject

2019-10-28 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16491 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16963 ___ Python tracker <https://bugs.python.org/issu

[issue38617] Using Py_XINCREF to replace Py_INCREF in PyAST_CompileObject

2019-10-28 Thread hai shi
New submission from hai shi : 1) param is unpredictable; 2) the compiler_free() use Py_XDECREF(c->c_filename) in PyAST_CompileObject(); -- components: Interpreter Core messages: 355547 nosy: shihai1991 priority: normal severity: normal status: open title: Using Py_XINCREF to repl

[issue38616] Using Py_XDECREF to replace Py_DECREF in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16490 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16962 ___ Python tracker <https://bugs.python.org/issu

[issue38616] Using Py_XDECREF to replace Py_DECREF in PyAST_FromNodeObject()

2019-10-28 Thread hai shi
New submission from hai shi : `if (c.c_normalize) { Py_DECREF(c.c_normalize); }` --> `Py_XDECREF(c.c_normalize);` -- components: Interpreter Core messages: 355545 nosy: shihai1991 priority: normal severity: normal status: open title: Using Py_XDECREF to replace Py_DEC

[issue38600] Change the mark up of NULL

2019-10-28 Thread hai shi
hai shi added the comment: Ok, it's fine to me. -- ___ Python tracker <https://bugs.python.org/issue38600> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38600] Change the mark up of NULL

2019-10-28 Thread hai shi
hai shi added the comment: In 'If *exc* is *NULL*, then the exception is cleared and the value is clipped to *PY_SSIZE_T_MIN* for a negative integer or *PY_SSIZE_T_MAX* for a positive integer.', should PY_SSIZE_T_MIN and PY_SSIZE_T_MAX be changed too? -- nosy: +shihai1991

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-18 Thread hai shi
hai shi added the comment: Thanks, Serhiy, you are right. -- ___ Python tracker <https://bugs.python.org/issue38465> ___ ___ Python-bugs-list mailing list Unsub

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-13 Thread hai shi
hai shi added the comment: sorry, typo error. # the ob_exports would be overflow in 32 bit machine when i = 2**31. --> # the ob_exports would be overflow in 64 bit machine when i = 2**31. -- ___ Python tracker <https://bugs.python.org/issu

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-13 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16322 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16746 ___ Python tracker <https://bugs.python.org/issu

[issue38465] The type of ob_exports in PyByteArrayObject become Py_ssize_t.

2019-10-13 Thread hai shi
New submission from hai shi : for a code example: ``` v = [] b = bytearray(0x) for i in range(2**31+1) # the ob_exports would be overflow in 32 bit machine when i = 2**31. v.append(memoryview(b)) ``` IMHO, i thought converting the type of ob_exports to Py_ssize_t is fine. PS: I

[issue38419] The path of check-c-globals.py on README is wrong

2019-10-09 Thread hai shi
hai shi added the comment: Maybe the keyword need add the `easy` wrod? (i don't know the internals) newcomer need find it in `Easy issues` ;) -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue38

[issue16623] argparse help formatter does not honor non-breaking space

2019-10-08 Thread hai shi
hai shi added the comment: oh, typo error. the help_lines' width in python2.7 is different python3.-->the help_lines' width in python2.7 is different with python3.x -- ___ Python tracker <https://bugs.python.org/issu

[issue16623] argparse help formatter does not honor non-breaking space

2019-10-08 Thread hai shi
hai shi added the comment: I checked the help format. the help_lines' width in python2.7 is different python3. The width is more likely a hardcode in https://github.com/python/cpython/blob/2.7/Lib/argparse.py#L165. , so the help_lines = [u'This is a very long help string. ex: "--s3',

[issue38390] Got a compile warning in dictobject.c

2019-10-07 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16198 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16610 ___ Python tracker <https://bugs.python.org/issu

[issue38390] Got a compile warning in dictobject.c

2019-10-07 Thread hai shi
Change by hai shi : -- title: Got an compile warning in dictobject.c -> Got a compile warning in dictobject.c ___ Python tracker <https://bugs.python.org/issu

[issue38390] Got an compile warning in dictobject.c

2019-10-07 Thread hai shi
New submission from hai shi : The warning detail: Objects/dictobject.c: In function ‘_PyDictView_Intersect’: Objects/dictobject.c:4189:15: warning: unused variable ‘tmp’ [-Wunused-variable] PyObject *tmp; ^ -- components: Build messages: 354068 nosy: shihai1991

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-07 Thread hai shi
hai shi added the comment: > The PR's Misc/NEWS entry, "Fix behavior of argparse when '--' as argument to > option", is insufficient. Thanks for your comment, Raymond. I would continue update the desc. -- ___ Python

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +16191 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16603 ___ Python tracker <https://bugs.python.org/issu

[issue38383] undefined behavior in tailmatch() of bytes_methods.c

2019-10-06 Thread hai shi
New submission from hai shi : `if (start + slen > len)` would cause undefined behavior? such as: start=PY_SSIZE_T_MAX, slen=1 REFS: [1] https://github.com/python/cpython/blob/master/Objects/bytes_methods.c#L746 -- components: Interpreter Core messages: 354032 nosy: shihai1991 prior

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-10-05 Thread hai shi
hai shi added the comment: Hi, Jonas. Thanks for your report. Let us wait core team's discuss;) -- ___ Python tracker <https://bugs.python.org/issue14

[issue38273] Got an compile failed info about typeobject.c

2019-09-25 Thread hai shi
hai shi added the comment: oh, thanks, guys. This error info is disappeared when i followed victor's advice. It must be i changed the configure/make file by accident. Sorry for this noisy info -- resolution: -> not a bug stage: -> resolved status: open -&g

[issue38140] Py_tp_dictoffset / Py_tp_finalize are unsettable in stable API

2019-09-25 Thread hai shi
hai shi added the comment: Got an compile error, i have not check the detail for now: python: Objects/typeobject.c:2867: PyType_FromSpecWithBases: Assertion `memb->type == 19' failed. i report it in bpo 38273 -- nosy: +shihai1991 ___ Pyt

[issue38273] Got an compile failed info about typeobject.c

2019-09-25 Thread hai shi
New submission from hai shi : Got an compile error, my OS is gcc version 4.8.5 20150623 (Red Hat 4.8.5-36: CC='gcc -pthread' LDSHARED='gcc -pthread -shared' OPT='-g -Og -Wall' _TCLTK_INCLUDES='' _TCLTK_LIBS='' ./python -E ./setup.py build python: Objects/typeobject.c:2867

[issue38253] Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h

2019-09-22 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +15906 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16230 ___ Python tracker <https://bugs.python.org/issu

[issue38253] Fix typo of Py_SET_ERANGE_IF_OVERFLOW in pyport.h

2019-09-22 Thread hai shi
New submission from hai shi : Py_SET_ERANGE_ON_OVERFLOW should be changed to Py_SET_ERANGE_IF_OVERFLOW in pyport.h. -- assignee: docs@python components: Documentation messages: 352981 nosy: docs@python, shihai1991 priority: normal severity: normal status: open title: Fix typo

[issue19692] Rename Py_SAFE_DOWNCAST

2019-09-14 Thread hai shi
hai shi added the comment: Looks we have a fast version rhythm. IMHO, If user would be affected and reported, reversing the PR is ok. -- ___ Python tracker <https://bugs.python.org/issue19

[issue38168] Refleaks in setint() of mmapmodule.c

2019-09-14 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +15746 stage: -> patch review pull_request: https://github.com/python/cpython/pull/16136 ___ Python tracker <https://bugs.python.org/issu

[issue38168] Refleaks in setint() of mmapmodule.c

2019-09-14 Thread hai shi
Change by hai shi : -- title: Reflaks in setint() of mmapmodule.c -> Refleaks in setint() of mmapmodule.c ___ Python tracker <https://bugs.python.org/issu

[issue38168] Reflaks in setint() of mmapmodule.c

2019-09-14 Thread hai shi
New submission from hai shi : As the title said, in `setint` function, the refcount of `o` should decreased all the time. -- components: Interpreter Core messages: 352412 nosy: shihai1991 priority: normal severity: normal status: open title: Reflaks in setint() of mmapmodule.c type

[issue9938] Add optional keyword argument exit_on_error to argparse.ArgumentParser

2019-09-12 Thread hai shi
hai shi added the comment: Stéphane, thanks for your good comment. Some argparse's bpo is too old ;) -- ___ Python tracker <https://bugs.python.org/issue9

[issue37750] PyBuffer_FromContiguous not documented

2019-09-11 Thread hai shi
Change by hai shi : -- pull_requests: +15617 pull_request: https://github.com/python/cpython/pull/15988 ___ Python tracker <https://bugs.python.org/issue37

[issue38053] Update plistlib documentation

2019-09-08 Thread hai shi
hai shi added the comment: >* Remove notes about the new API being added in 3.4 since 3.4 is no longer >supported Related bpo in issue14455 -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/i

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
Change by hai shi : -- nosy: +rhettinger type: -> behavior ___ Python tracker <https://bugs.python.org/issue14364> ___ ___ Python-bugs-list mailing list Un

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
Change by hai shi : -- pull_requests: +15369 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15714 ___ Python tracker <https://bugs.python.org/issu

[issue14364] Argparse incorrectly handles '--' as argument to option

2019-09-05 Thread hai shi
hai shi added the comment: some test cases which paul provided looks doesn't keep compatible. In TestDoubleDashRemoval: # output in my env is Namespace(cmd='cmd', foo=None, rest=['--', '--foo']) ('-- cmd -- -- --foo', NS(cmd='cmd', foo=None, rest=['--', '--', '--foo'])) # output in my env

[issue9938] Add optional kwargs to argparse

2019-09-04 Thread hai shi
Change by hai shi : -- nosy: +rhettinger ___ Python tracker <https://bugs.python.org/issue9938> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: oh, sorry, pls ignore it. I misunderstand your opinion. -- type: crash -> behavior ___ Python tracker <https://bugs.python.org/issu

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
Change by hai shi : -- pull_requests: +15323 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15656 ___ Python tracker <https://bugs.python.org/issu

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: Thanks, Raymond. This patch not a formal patch, just show what i want to do. if everything agree this behavior, I would add a normal PR. -- type: behavior -> crash ___ Python tracker <https://bugs.python.org/issu

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: Adding a judgment of explicit_args in judgment statement in the patch. -- keywords: +patch Added file: https://bugs.python.org/file48582/parse_v1.patch ___ Python tracker <https://bugs.python.org/issue36

[issue36267] User input to argparse raises Index_Error: "-a=" on a 'store_true' action

2019-09-02 Thread hai shi
hai shi added the comment: I do something such as: p = argparse.ArgumentParser() p.add_argument('-a', action='store_true') p.add_argument('-b', action='store_true') p.parse_args('-ab='.split()) thos code code jump in 1903, and the explicit_arg's value is: 'b=' 1901 action_tuples.append

[issue15125] argparse: positional arguments containing - in name not handled well

2019-08-29 Thread hai shi
hai shi added the comment: How about: 1. Adding documentation as steven said. 2. If user use '-' of positional arguments in latest cpython, we cloud remind user that `the '-' of positional arguments be replaced by '_' since cpython 4.0` 3.Applying Simon Law's patch. -- nosy

[issue9351] argparse set_defaults on subcommands should override top level set_defaults

2019-08-27 Thread hai shi
hai shi added the comment: How about use a flag(such USING_OUT_NAMESPACE) to identify we use namespace or not? For example: subnamespace, arg_strings = parser.parse_known_args(arg_strings, None) for key, value in vars(subnamespace).items(): if USING_OUT_NAMESPACE and not hasattr

[issue37908] Add an example of ArgumentParser.exit()

2019-08-24 Thread hai shi
Change by hai shi : -- nosy: +bethard ___ Python tracker <https://bugs.python.org/issue37908> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37908] Add an example of ArgumentParser.exit()

2019-08-24 Thread hai shi
Change by hai shi : -- title: Add some examples of ArgumentParser.exit() -> Add an example of ArgumentParser.exit() type: -> resource usage ___ Python tracker <https://bugs.python.org/i

[issue37908] Add some examples of ArgumentParser.exit()

2019-08-24 Thread hai shi
hai shi added the comment: Adding an example of ArgumentParser.exit(), because some user would like cathing errors manually or consider exit progress or not when an error occurs. I have not add example of ArgumentParser.error(), because i can not think some user scenarios

[issue37908] Add some examples of ArgumentParser.exit()

2019-08-24 Thread hai shi
Change by hai shi : -- keywords: +patch pull_requests: +15150 stage: -> patch review pull_request: https://github.com/python/cpython/pull/15455 ___ Python tracker <https://bugs.python.org/issu

[issue9938] Add optional kwargs to argparse

2019-08-23 Thread hai shi
Change by hai shi : -- title: Improving interactive use of argparse -> Add optional kwargs to argparse ___ Python tracker <https://bugs.python.org/iss

[issue37908] Add some examples of ArgumentParser.exit()

2019-08-21 Thread hai shi
Change by hai shi : -- nosy: +paul.j3 ___ Python tracker <https://bugs.python.org/issue37908> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37908] Add some examples of ArgumentParser.exit()

2019-08-21 Thread hai shi
hai shi added the comment: issue 9938 -- ___ Python tracker <https://bugs.python.org/issue37908> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37908] Add some examples of ArgumentParser.exit()

2019-08-21 Thread hai shi
New submission from hai shi : As paul said in bpo 9938: The exit and error methods are mentioned in the 3.4 documentation, but there are no examples of modifying them. 16.4.5.9. Exiting methods ArgumentParser.exit(status=0, message=None) ArgumentParser.error(message) I

[issue37698] Update doc of PyBuffer_ToContiguous

2019-08-21 Thread hai shi
Change by hai shi : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue37698> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue37750] PyBuffer_FromContiguous not documented

2019-08-21 Thread hai shi
Change by hai shi : -- nosy: +pitrou ___ Python tracker <https://bugs.python.org/issue37750> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyth

[issue37775] update doc of compileall

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

[issue9938] Improving interactive use of argparse

2019-08-21 Thread hai shi
hai shi added the comment: It is a good idea. So I update this title and add PR 15362. I am not sure there have a problem of xuanli's CLA or not~ -- components: -Documentation nosy: +shihai1991 title: Documentation for argparse interactive use -> Improving interactive

[issue9938] Documentation for argparse interactive use

2019-08-21 Thread hai shi
Change by hai shi : -- pull_requests: +15073 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/15362 ___ Python tracker <https://bugs.python.org/iss

[issue37887] some leak in the compiler_assert function

2019-08-20 Thread hai shi
hai shi added the comment: Ok, got it. -- ___ Python tracker <https://bugs.python.org/issue37887> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37887] some leak in the compiler_assert function

2019-08-19 Thread hai shi
New submission from hai shi : Some reference leak in compiler_assert function, due to not using Py_DECREF(assertion_error) before return. And having a question about code order in compiler_assert function. -- components: Interpreter Core files: compiler_assert.patch keywords: patch

[issue9350] add remove_argument_group to argparse

2019-08-18 Thread hai shi
hai shi added the comment: paul, raymond. Thanks for give me a quick answer:). Looks raymond's reason is good enough, i just only consider this question from api completeness(as paul said) not from user case. -- ___ Python tracker <ht

[issue9350] add remove_argument_group to argparse

2019-08-18 Thread hai shi
hai shi added the comment: IMHO, if we supply the ability to add an argument group, we need add the ability to remove the argument group too. -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue9

[issue37583] Got a 113 error when running the test_socket

2019-08-13 Thread hai shi
Change by hai shi : -- pull_requests: +14978 pull_request: https://github.com/python/cpython/pull/15259 ___ Python tracker <https://bugs.python.org/issue37

[issue37583] Got a 113 error when running the test_socket

2019-08-12 Thread hai shi
hai shi added the comment: Oh, sorry, victor. I use ./python -m unittest xxx before. Updating the test result again. -- Added file: https://bugs.python.org/file48538/test_socket_fail_info_v2.txt ___ Python tracker <https://bugs.python.

[issue37811] [FreeBSD, OSX] Socket module: incorrect usage of poll(2)

2019-08-11 Thread hai shi
hai shi added the comment: I found an OS distinguishing behavior in https://github.com/python/cpython/blob/master/Modules/selectmodule.c#L603-L612 -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue37

[issue37496] Support annotations in signature strings.

2019-08-11 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker <https://bugs.python.org/issue37496> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    1   2   3   4   5   6   7   8   >