[issue21475] Support the Sitemap extension in robotparser

2018-04-16 Thread Steven Steven
Steven Steven added the comment: Kindly add a test for this issue -- nosy: +stevensalbert ___ Python tracker <https://bugs.python.org/issue21475> ___ ___ Pytho

[issue33288] Diethealth

2018-04-16 Thread Steven Steven
New submission from Steven Steven : sue -- messages: 315363 nosy: stevensalbert priority: normal severity: normal status: open title: Diethealth ___ Python tracker <https://bugs.python.org/issue33

[issue33288] Diethealth

2018-04-16 Thread Steven Steven
Steven Steven added the comment: http://www.diethealthsupplements.com/ -- ___ Python tracker <https://bugs.python.org/issue33288> ___ ___ Python-bugs-list mailin

[issue45504] [argparse] Entering a partial config_parser flag works with subparsers

2021-10-17 Thread Steven
New submission from Steven : I have a package with a module called `commands.py`. This file is basically three sub parsers and an entry point. Here is one of my subparsers. It shows the current path of a config file, and lets you update the path if you want. #config sub-command

[issue28926] subprocess.Popen + Sqlalchemy doesn't wait for process

2016-12-09 Thread Steven
New submission from Steven: Called subprocess.Popen("python_file.py", shell=True).wait(), which triggered a call to `Base.metadata.create_all(engine)` inside `python_file.py` This caused nothing after the `create_all(engine)` call to execute in `python_file.py` But, if

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: I agree that the rules regarding type and `__class__` and isinstance are not clear or well documented. We have: https://docs.python.org/3/library/stdtypes.html#instance.__class__ https://docs.python.org/3/library/functions.html#isinstance but ne

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Fri, Dec 10, 2021 at 12:03:15AM +, Gabriele N Tornetta wrote: > class Side(object): > def __getattribute__(self, name): > ValueError(name) You forgot to actually *raise* the exception. That will just instantiate the Value

[issue32683] isinstance is calling ob.__getattribute__ as a fallback instead of object.__class__.__get__

2021-12-10 Thread Steven D'Aprano
Steven D'Aprano added the comment: The plot thickens. I was wrong to say that type() always and only looks at the "real" underlying type of the instance. type() does look at __class__ as well. But only sometimes. >>> class A: ... __class__ = int ... >>

[issue23522] Misleading note in Statistics module documentation

2021-12-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Prompted by Guido's reopening of the ticket, I have given it some more thought, and have softened my views. Jake if you're still around, perhaps there is more to what you said than I initially thought, and I just needed fresh eyes to see

[issue46112] PEP 8 code format

2021-12-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: > not complied with the PEP-8 formatting. PEP 8 says: "Some other good reasons to ignore a particular guideline: 3. Because the code in question predates the introduction of the guideline and there is no other reason to be modifying that cod

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: The function you use in exec is not a closure. The function: def f(): return a does not capture the top-level variable "a", it does a normal name lookup for a. You can check this yourself by looking at f.__closure__ which you wi

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: Here is the key phrase in the docs: "If exec gets two separate objects as globals and locals, the code will be executed as if it were embedded in a class definition." https://docs.python.org/3/library/functions.html#exec And sure enoug

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I now want to define a closure with exec. I might want to do something like: > exec("def f(): return a", globals(), locals()) That doesn't create a closure. > I would expect f() to look for a in the locals(). I'm

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: "Expected" is a strong word. It took me a lot of careful reading of the documentation and experimentation to decide that, yes, I expect the second case to fail when the first case succeeds. Which reminds me of a common anecdote from math

[issue46153] function fails in exec when locals is given

2021-12-22 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Dec 23, 2021 at 12:15:29AM +, Eryk Sun wrote: > > Eryk Sun added the comment: > > > If exec gets two separate objects as globals and locals, > > the code will be executed as if it were embedded in a > >

[issue46153] function fails in exec when locals is given

2021-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Thu, Dec 23, 2021 at 05:47:33AM +, Eryk Sun wrote: > > Eryk Sun added the comment: > > > That's taken straight out of the documentation. > > Yes, but it's still a misleading comparison. I asked how you wou

[issue46164] New `both()` operator for matching multiple variables to one

2021-12-23 Thread Steven D'Aprano
Steven D'Aprano added the comment: Just use if a == b == 1: Comparisons can be chained arbitrarily. https://docs.python.org/3/reference/expressions.html#comparisons -- nosy: +steven.daprano resolution: -> rejected stage: -> resolved status: ope

[issue46173] float(x) with large x not raise OverflowError

2021-12-24 Thread Steven D'Aprano
Steven D'Aprano added the comment: float(x) performs rounding. Only if the value after rounding is out of range is OverflowError raised. M + 1, when correctly rounded to the nearest even float, gives sys.float_info.max. Likewise for M+2, M+3 etc all the way to M+K where K equals 2

[issue46183] float function errors on negative number string with comma seperator ex: '-1, 234.0'

2021-12-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: The behaviour is correct and not a bug. Commas are not supported when converting strings to float. The allowed format for floats as strings is described in the docs: https://docs.python.org/3/library/functions.html#float By the way, the negative si

[issue46183] float function errors on negative number string with comma seperator ex: '-1, 234.0'

2021-12-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Aside: for what it is worth, the British style with a middle dot is also not supported: float('1·234') also raises ValueError. -- ___ Python tracker <https://bugs.pyt

[issue46188] dictionary creation error

2021-12-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: > I still can not figure out why the first two elements are inconsistent from the rest of the dictionary, and why they appear in the first place. Hi Tobias, This is a bug tracker for reporting bugs in Python, not a help desk to ask for explanati

[issue46199] Calculation influenced by print

2021-12-30 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please try to provide a minimal reproducible example: https://stackoverflow.com/help/minimal-reproducible-example http://sscce.org/ At the very least, you need to provide three pieces of information: 1. What you tried. 2. What you expected to happen

[issue46213] webbrowser.open doesn't work in Termux

2021-12-31 Thread Steven D'Aprano
Steven D'Aprano added the comment: I think the existence of sys.getandroidapilevel is evidence that Android is somewhat supported, even if it is not supported to the same degree that Linux and Windows are. https://docs.python.org/3/library/sys.html#sys.getandroidapilevel See also:

[issue46282] print() docs do not indicate its return value

2022-01-06 Thread Steven D'Aprano
New submission from Steven D'Aprano : Do the print docs need to mention something so obvious? Functions and methods which operate by side-effect typically don't mention that they return None, see for example the docs for various builtin methods: https://docs.python.org

[issue46282] print() docs do not indicate its return value

2022-01-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Sure, there will always be some users who will find certain things not obvious. Sometimes I'm that user myself. What did this user think print() returned? What precisely was their question? Perhaps if I saw the conversation in context, I wou

[issue46293] Typo in specifying escape sequence

2022-01-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Serhiy is correct. The table is correct, \n can be found further down the table, the first entry is backslash newline, as it says. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: ope

[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Steven Wirsz
New submission from Steven Wirsz : Compiling source from github on January 6, 2022, detected via Libfuzzer & UndefinedBehaviorSanitizer: # ./fuzz_struct_unpack crash-a0d.txt Running: crash-a0d.txt /src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which is n

[issue46294] Integer overflow & Int values loaded into Bool detected via Libfuzzer & UndefinedBehaviorSanitizer

2022-01-07 Thread Steven Wirsz
Steven Wirsz added the comment: Closing this report. I investigated the remaining issue and it looks like a perfectly valid call to PyBool_FromLong: /src/cpython3/Modules/_struct.c:509:28: runtime error: load of value 128, which is not a valid value for type '_Bool' stati

[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: > it returns IndexError (instead of "u") if used in a list comprehension Works as expected inside a list comprehension: >>> var = "u2" >>> [var.strip()[0] for i in range(2)] ['u', 'u'] >

[issue46302] IndexError inside list comprehension + workaround

2022-01-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Your functions test1 and test2 are irrelevant to the bug report. The driver code using eval() to pick which function to call is unneeded. The business of simulating a file is complexity for no purpose. Those ignore, count, unique functions are

[issue46324] 'import traceback' Causes a Crash

2022-01-09 Thread Steven D'Aprano
Steven D'Aprano added the comment: Your module token.py "shadowed" the stdlib token.py, and prevented it from being seen until you changed the name. -- nosy: +steven.daprano resolution: -> not a bug stage: -> resolved status: open -> closed

[issue46349] inspect.getdoc() should append parent class method docs when encountering a local one line docstring

2022-01-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: Many docstrings are only 1 line without being "See base class." And many docstrings are multiple lines while also referring the reader to see the parent class for further details. So this DWIM heuristic to guess whether or not to display

[issue46350] re.sub, re.Match.expand, etc doesn't allow x, u, U, or N escapes in the template

2022-01-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: It is better to raise each issue in its own ticket. You seem to have three distinct issues here: - The issue listed in the title, which I don't understand. A demonstration of the issue would be helpful. - The unrelated(?) issue of bad \N{} esca

[issue46354] AttributeError: module 'collections' has no attribute 'Mapping'

2022-01-12 Thread Steven D'Aprano
Steven D'Aprano added the comment: Hi mareklachbc, What makes you think that this is a bug? Since at least version 3.7, you will have seen this warning: >>> import collections >>> collections.Mapping __main__:1: DeprecationWarning: Using or

[issue46365] _ curses module is not installed

2022-01-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: Did you look in setup.py in detect_modules() for the module's name to see what was missing? How do you know the curses dependencies have been installed? What dependencies did you install? -- nosy: +stev

[issue46385] Remove parenthetical symbols for readability and nlp

2022-01-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Dennis beat me to it in saying that tuples cannot be replaced by lists. But I also wanted to say that it is *not true* that removing bracket symbols would increase readability. Natural language allows parenthetical phrases -- which can be bracketed

[issue46385] Remove parenthetical symbols for readability and nlp

2022-01-14 Thread Steven D'Aprano
Steven D'Aprano added the comment: Please don't reopen this issue. If you really want to take it to the Python-Ideas mailing list, you can: https://mail.python.org/mailman3/lists/python-ideas.python.org/ or to Discuss: https://discuss.python.org/c/ideas/6 -- status: open

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: The difficulty is that frozenset may have been shadowed, or builtins monkey-patched, so we cannot know what frozenset({1, 2, 3}) will return until runtime. Should we re-consider a frozenset display literal? f{1, 2, 3} works for me. --

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: Proposed on Python-Ideas. https://mail.python.org/archives/list/python-id...@python.org/message/GRMNMWUQXG67PXXNZ4W7W27AQTCB6UQQ/ -- ___ Python tracker <https://bugs.python.org/is

[issue46393] Generate frozenset constants when explicitly appropriate

2022-01-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: That's not always the case though. >>> def f(): ... return frozenset({1, 2, 3}) ... >>> a = f.__code__.co_consts[1] >>> a frozenset({1, 2, 3}) >>> b = f() >>> assert a == b >>>

[issue46466] help function reads comments

2022-01-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: That's not a bug. https://docs.python.org/3/library/pydoc.html "If there is no docstring, pydoc tries to obtain a description from the block of comment lines just above the definition of the class, function or method in the source file, o

[issue46467] Rounding 5, 50, 500 behaves differently depending on preceding value

2022-01-21 Thread Steven D'Aprano
Steven D'Aprano added the comment: As documented, this is not a bug. "if two multiples are equally close, rounding is done toward the even choice" https://docs.python.org/3/library/functions.html#round This is also called "Banker's Rounding" or "Round h

[issue46612] Unclear behavior of += operator

2022-02-02 Thread Steven D'Aprano
Steven D'Aprano added the comment: You say: "The documentation says ..." but don't tell us which documentation. This documentation: https://docs.python.org/3/reference/simple_stmts.html#augmented-assignment-statements tells us that augmented assignment is assign

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: I don't understand why math.ceildiv couldn't ducktype. There's no rule that says it *must* convert arguments to float first, that's just a convention, and we've broken it before. >>> math.prod([Fraction(1, 3), 7]) Fra

[issue46639] Ceil division with math.ceildiv

2022-02-07 Thread Steven D'Aprano
Steven D'Aprano added the comment: Decimal is a good question. Why does floor division not do floor division on Decimal? The documentation says The integer division operator // behaves analogously, returning the integer part of the true quotient (truncating towards zero) r

[issue39805] Copying functions doesn't actually copy them

2022-02-13 Thread Steven D'Aprano
Steven D'Aprano added the comment: If we can't change the default behaviour of copying functions, can we add a specialised copy_function() function, for when we really need to make a genuine copy? -- ___ Python tracker <https://bu

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-15 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm sorry, I don't see why you think this will improve code readability. I also expect it will be harder to teach than the current code. open("file.img", "wb") just needs the user to learn about reading and writing files

[issue46766] Add a class for file operations so a syntax such as open("file.img", File.Write | File.Binary | File.Disk) is possible.

2022-02-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: True, but you did say it would be with the io module in your original suggestion. -- ___ Python tracker <https://bugs.python.org/is

[issue46776] RecursionError when using property() inside classes

2022-02-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: This is not a bug, Python is working correctly here. The interpreter is doing exactly what you told it to do, and then raising a RecursionError before you can crash the system. You have a property instance.bar which returns instance.bar, which re

[issue46776] RecursionError when using property() inside classes

2022-02-17 Thread Steven D'Aprano
Steven D'Aprano added the comment: Maybe you expected to do this: class C: def __init__(self): self._value = 999 @property def bar(self): return self._value obj = C() obj.bar # returns 999 -- ___ Python tr

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-19 Thread Steven D'Aprano
Steven D'Aprano added the comment: Replicated on Linux, Python 3.10. It looks like mousewheel scrolling jumps by the wrong amount as it pages down (or up), and consequently some lines never appear in the view area. I ran a slightly modified version of the code that had 16 entries inste

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- Removed message: https://bugs.python.org/msg413566 ___ Python tracker <https://bugs.python.org/issue46803> ___ ___ Pytho

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- Removed message: https://bugs.python.org/msg413567 ___ Python tracker <https://bugs.python.org/issue46803> ___ ___ Pytho

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- Removed message: https://bugs.python.org/msg413568 ___ Python tracker <https://bugs.python.org/issue46803> ___ ___ Pytho

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : -- nosy: -xiaox55066 ___ Python tracker <https://bugs.python.org/issue46803> ___ ___ Python-bugs-list mailing list Unsubscr

[issue46803] Item not shown when using mouse wheel to scroll for Listbox/Combobox

2022-02-20 Thread Steven D'Aprano
Change by Steven D'Aprano : Removed file: https://bugs.python.org/file50635/6.jpeg ___ Python tracker <https://bugs.python.org/issue46803> ___ ___ Python-bugs-list m

[issue46871] BaseManager.register no longer supports lambda callable 3.8.12+

2022-02-26 Thread Steven D'Aprano
Steven D'Aprano added the comment: Works for me in Python 3.10.0 on Linux. After running your code, I get shared_dict is a DictProxy: >>> shared_dict >>> list(shared_dict.items()) [('number', 0), ('text', 'Hello World')] and shared_lo

[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Both arguments `aliased` and `terse` should be boolean instead of integer. Why should they be strictly True/False booleans? I disagree strongly that they should be. Any object that duck-types as a true or false value is sufficient. Trea

[issue46883] Add glossary entries to clarify the true/True and false/False distinction

2022-02-28 Thread Steven D'Aprano
New submission from Steven D'Aprano : There is a long-standing tradition, going back to Python 1.x days before we had dedicated True and False values, to use the lowercase "true" and "false" to mean *any value that duck-types as True* and *any value that duck-type

[issue46882] Clarify argument type of platform.platform(aliased, terse) to boolean

2022-02-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: See #46883 -- ___ Python tracker <https://bugs.python.org/issue46882> ___ ___ Python-bugs-list mailing list Unsubscr

[issue46883] Add glossary entries to clarify the true/True and false/False distinction

2022-02-28 Thread Steven D'Aprano
Steven D'Aprano added the comment: Note also that this is mentioned here: https://docs.python.org/3/library/stdtypes.html#boolean-values "[True and False] are used to represent truth values (although other values can also be considered false or true)." although it is perha

[issue46871] Lambda can't be pickled with "spawn" and only "fork"

2022-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: > The "spawn" method requires pickling the data and callable passed to > the child proces, and that's not supported for lambda's. Ah, today I learned something. Kyle, looks like you were right about it being due to the lambd

[issue46871] Lambda can't be pickled with "spawn" and only "fork"

2022-03-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Oops, replying by email reopens the ticket. Back to pending you go! -- status: open -> pending ___ Python tracker <https://bugs.python.org

[issue46923] Implement stack overflow protection for supported platforms

2022-03-04 Thread Steven D'Aprano
Steven D'Aprano added the comment: > Personally I'd prefer a new exception `StackOverflow` to `MemoryError` +1 on a new exception (presumably a subclass of MemoryError). How about using OverflowedStack instead? The situation is not quite as bad as you suggest. Googling for &q

[issue1233] bsddb.dbshelve.DbShelf.append doesn't work

2007-10-03 Thread Steven Vereecken
New submission from Steven Vereecken: The check for DB_RECNO seems to do the opposite of what it's supposed to do: def append(self, value, txn=None): if self.get_type() != db.DB_RECNO: self.append = self.__append return self.append(value, tx

[issue13540] Document the Action API in argparse

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Sorry about being out of contact (I'm flying back and forth between the US and the EU every 4-5 weeks right now), and thanks Terry for bringing this to my attention. Essentially, the API is: * The argument to action= must be a callable that accepts at

[issue13584] argparse doesn't respect double quotes

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Can you submit some example code that shows this? I can't reproduce this with: -- temp.py -- import argparse parser = argparse.ArgumentParser() parser.add_argument("--ng", action="store_true") parser.ad

[issue12776] argparse: type conversion function should be called only once

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Could you add a test to verify that custom actions are still getting the converted values passed to their __call__? I suspect this may not be happening under the current patch - if that's the case, you may also need to add conversions in _get_values,

[issue10772] Several actions for argparse arguments missing from docs

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Looks good to me too. -- ___ Python tracker <http://bugs.python.org/issue10772> ___ ___ Python-bugs-list mailing list Unsub

[issue13249] argparse.ArgumentParser() lists arguments in the wrong order

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: The ArgumentParser constructor is definitely only intended to be called with keyword arguments, so it's definitely a documentation bug that it doesn't say this. I haven't actually applied the patch, but the basic approach and wording

[issue13271] When -h is used with argparse, default values that fail should not matter

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: I think http://bugs.python.org/issue12776, which delays type conversions on defaults should solve this problem, right? If you agree, could you add your code here as a test case to that issue and mark this as duplicate? (And yes, I agree this is a bug

[issue13041] argparse: terminal width is not detected properly

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: I'd feel more comfortable with the argparse fix if it were simply calling "os.get_terminal_size()". I recommend that you: * Create a new issue called, say "add os.get_terminal_size()" proposing just the single method. * Add that iss

[issue12806] argparse: Hybrid help text formatter

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: As I understand it the current proposal is: * Wrap each paragraph separately * Don't wrap any lines indented by at least one additional space This sounds like a useful formatter. I would probably call it "PargraphWrappingFormatter" or some

[issue9253] argparse: optional subparsers

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: If you can make your patch relative to the cpython source tree, and add a couple tests, it will be easier to review. Thanks for working on this! -- ___ Python tracker <http://bugs.python.org/issue9

[issue13023] argparse should allow displaying argument default values in addition to setting a formatter class

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Your solution is actually the current recommended solution - mix together both classes that you want to combine and pass your subclass as the parameter. This should probably be documented somewhere (and tested more

[issue12713] argparse: allow abbreviation of sub commands by users

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Modulo the comments already on the patch by others, this approach looks fine to me. -- ___ Python tracker <http://bugs.python.org/issue12

[issue12686] argparse - document (and improve?) use of SUPPRESS with help=

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Could you give some examples of bugs that you observed? Otherwise, this looks like a duplicate of issue 9349. The intention is that help=SUPPRESS should cause the given argument to not be displayed in the help message. If there are cases where that'

[issue11708] argparse: suggestion for formatting optional positional args

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: I agree that this is a bug in current argparse formatting. It might be a little difficult to fix though because the current option formatting handles arguments one at a time, and producing something like [arg1 [arg2]] requires some understanding of how

[issue12284] argparse.ArgumentParser: usage example option

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: %(prog)s is available in epilog: -- temp.py -- import argparse epilog = """\ Example usage: %(prog)s option1 option2 """ parser = argparse.ArgumentParser( formatter_class=argparse.RawTextHe

[issue9938] Documentation for argparse interactive use

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Looks good to me. -- ___ Python tracker <http://bugs.python.org/issue9938> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11839] argparse: unexpected behavior of default for FileType('w')

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: I think Issue 12776, which delays type conversions on defaults, should solve this problem, right? If you agree, could you add your code here as a test case to that issue and mark this as duplicate? -- ___ Python

[issue11874] argparse assertion failure with brackets in metavars

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: I agree this is a bug. The patch needs to add unit tests that make sure metavars with [] work as expected. -- ___ Python tracker <http://bugs.python.org/issue11

[issue11807] Documentation of add_subparsers lacks information about parametres

2011-12-15 Thread Steven Bethard
Steven Bethard added the comment: Looks good. A few minor comments (click "review" by the patch). -- ___ Python tracker <http://bugs.python.o

[issue13605] document argparse's nargs=REMAINDER

2011-12-15 Thread Steven Bethard
New submission from Steven Bethard : There is an undocumented value for add_argument's nargs parameter, REMAINDER, which can be used to consume all the remaining arguments. This is commonly useful for command line utilities that dispatch to other command line utilities. Though undocum

[issue13584] argparse doesn't respect double quotes

2011-12-16 Thread Steven Bethard
Steven Bethard added the comment: Closing then. Thanks for checking it again! -- assignee: -> bethard resolution: -> works for me stage: -> committed/rejected status: open -> closed ___ Python tracker <http://bugs.python

[issue13685] argparse does not sanitize help strings for % signs

2012-01-10 Thread Steven Bethard
Steven Bethard added the comment: Eric's suggested doc fix looks good to me. -- ___ Python tracker <http://bugs.python.org/issue13685> ___ ___ Python-bugs-l

[issue12790] doctest.testmod does not run tests in functools.partial functions

2011-08-19 Thread Steven D'Aprano
New submission from Steven D'Aprano : Functions with docstrings which were created with partial are not run by doctest.testmod(). See the test script, which prints: Expected 1 failure from 2 tests, but got 0 from 0. -- files: partial_doctest.py messages: 142512 nosy: ste

[issue2636] Regexp 2.7 (modifications to current re 2.2.2)

2011-08-27 Thread Steven D'Aprano
Steven D'Aprano added the comment: I'm not sure if this belongs here, or on the Google code project page, so I'll add it in both places :) Feature request: please change the NEW flag to something else. In five or six years (give or take), the re module will be long forgotten

[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Matthew Barnett wrote: > Matthew Barnett added the comment: > > I think I need a show of hands. > > Should the default be old behaviour (like re) or new behaviour? (It might be > old now, new later.) > > Should there be a NE

[issue2636] Adding a new regex module (compatible with re)

2011-09-01 Thread Steven D'Aprano
Steven D'Aprano added the comment: Ezio Melotti wrote: > Ezio Melotti added the comment: > > Also note that some behaviors are not "old" or "compatible", but just > different. For example why inline flags should be the old (or new) behavior? > Or

[issue2636] Adding a new regex module (compatible with re)

2011-09-06 Thread Steven D'Aprano
Steven D'Aprano added the comment: Matthew Barnett wrote: > So, VERSION0 and VERSION1, with "(?V0)" and "(?V1)" in the pattern? Seems reasonable to me. +1 -- ___ Python tracker <h

[issue9571] argparse: Allow the use of -- to break out of nargs and into subparser

2010-08-12 Thread Steven Bethard
Steven Bethard added the comment: This is closely related to issue 9338. The parser should know that your command line requires at least the COMMAND argument, so it should stop parsing in time for that. However, in the case of subcommands, even if we solved issue 9338, you would still get

[issue9625] argparse: Problem with defaults for variable nargs

2010-08-17 Thread Steven Bethard
Changes by Steven Bethard : -- nosy: +bethard stage: -> needs patch versions: +Python 2.7, Python 3.2 -Python 2.6 ___ Python tracker <http://bugs.python.org/iss

[issue9653] New default argparse output to be added

2010-08-22 Thread Steven Bethard
Steven Bethard added the comment: A simpler approach might be to do this before your call to parse_args: if len(sys.argv[0]) == 1: parser.print_help() Does that solve your problem? -- ___ Python tracker <http://bugs.python.org/issue9

[issue9653] New default argparse output to be added

2010-08-22 Thread Steven Bethard
Steven Bethard added the comment: Sorry, typo. Should have been len(sys.argv) == 1. Full script: import argparse import sys parser = argparse.ArgumentParser() parser.add_argument('--foo') if len(sys.argv) == 1: parser.print_help() else: print(parser.parse_args()) With t

[issue9653] New default argparse output to be added

2010-08-24 Thread Steven Bethard
Steven Bethard added the comment: I see. When there are no arguments you basically want to replace the standard argparse help entirely with your own message, with your own capitalization, etc. What you're doing now looks like a pretty good approach for this, so I guess I'm still

[issue9694] argparse: Default Help Message Lists Required Args As Optional

2010-08-26 Thread Steven Bethard
Steven Bethard added the comment: Yeah, I guess the optional vs. positional isn't the best terminology now that you can have required flag-based arguments. Did you have a word other than "optional" that you'd prefer? -- ___ P

[issue9694] argparse: Default Help Message Lists Required Args As Optional

2010-08-27 Thread Steven Bethard
Steven Bethard added the comment: I guess one possibility might be "flag arguments". It's not great, but I guess it's more accurate. -- ___ Python tracker <http://bu

[issue9694] argparse: Default Help Message Lists Required Args As Optional

2010-08-27 Thread Steven Bethard
Steven Bethard added the comment: And I guess the bigger issue to think about is how to add this in a backwards compatible way. I guess we could just add methods like "set_positionals_group_name(name)" and then fiddle with "self._positionals.title" in there. Not sure tha

[issue9652] Tidy argparse default output

2010-08-27 Thread Steven Bethard
Steven Bethard added the comment: Looks like "usage" is almost always lowercase in the programs I tried (ssh, svn, cat, etc.). So it probably wouldn't be a good idea to change the default. Seems like both this and issue 9694 need a better way to customize the text in argparse

  1   2   3   4   5   6   7   8   9   10   >