[issue41740] Improve error message for string concatenation via `sum`

2020-09-07 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: I'd forgotten about ''.join; this is a good solution. I withdraw my comment. On Mon, Sep 7, 2020 at 3:25 PM Steven D'Aprano wrote: > > Steven D'Aprano added the comment: > > Marco, sum should be as fast as possible, so we don't want t

[issue41740] string concatenation via `sum`

2020-09-07 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : I'm not sure whether this is a bug or a feature request, but it seems as though the following should produce the same result: In [1]: 'a' + 'b' + 'c' Out[1]: 'abc' In [2]: sum(('a', 'b', 'c')) TypeError Traceback (most recent call last) in > 1

[issue36266] Which module could not be found?

2019-03-14 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: 'Should include "_ssl" somewhere in the message?' Exactly so. If a given import statement imports 30 items, it would be helpful to know which one caused the hickup. Thanks! On Wed, Mar 13, 2019 at 12:28 PM Steve Dower wrote: > > St

[issue36266] Which module could not be found?

2019-03-13 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: Hello Steve, I'm buying only 50 percent of this. The Python interpreter must know what module it was trying to import, and can at least be able to report that. Phillip On Tue, Mar 12, 2019 at 8:42 AM Steve Dower wrote: > > Steve Dower

[issue36266] Which module could not be found?

2019-03-11 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : I have a module that contains an import statement that imports a large number of items. This import was failing with the following error message: ImportError: DLL load failed: The specified module could not be found. The message would be so much more

[issue34417] imp.find_module reacts badly to iterator

2018-08-21 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: My apologies for the tone of my remark. I am grateful to you and others who donate their time to develop the code. I'm attaching the wrapper code that I created to work around the problem. Phillip def expander(paths='./*'): ""&qu

[issue34417] imp.find_module reacts badly to iterator

2018-08-20 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: It appears that the `importlib` package has the same issue: One can't provide an iterator for the path. When searching a large folder tree for an item that is likely to be found early in the search process (i.e., at a high level in the folder tree

[issue34417] imp.find_module reacts badly to iterator

2018-08-16 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : `imp.find_module` goes down in flames if one tries to pass an iterator rather than a list of folders. Firstly, the message that it produces is somewhat misleading: RuntimeError: sys.path must be a list of directory names Secondly, it would

[issue34299] argparse description formatting

2018-07-31 Thread Phillip M. Feldman
Phillip M. Feldman added the comment: That works. Thanks! I think that this boils down to a documentation issue. The following says that the default behavior is to line-wrap the help messages. At least to me, this doesn't imply that whitespace is getting eaten. RawDescriptionHelpFormatter

[issue34299] argparse description formatting

2018-07-31 Thread Phillip M. Feldman
New submission from Phillip M. Feldman : With `argparse`, I'm providing a triple-quoted string via the `description` argument of the constructor. When I invoke the script with the -h or --help argument, all formatting in the triple-quoted string is lost, i.e., all paragraphs are run

[issue13584] argparse doesn't respect double quotes

2011-12-15 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: Hello Steven, I'm embarrassed to report that I can't reproduce the problem. The input line is parsed correctly if I enclose the string 'Demo IO' in double quotes. It is parsed incorrectly if I enclose it in single quotes

[issue13185] Why does Python interpreter care about curvy quotes in comments?

2011-10-18 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: I'm beginning to understand the reasoning. This is quite a bit more complex than I initially thought, and I appreciate the explanations. Phillip On Sun, Oct 16, 2011 at 10:53 PM, Raymond Hettinger rep...@bugs.python.orgwrote

[issue13185] Why does Python interpreter care about curvy quotes in comments?

2011-10-16 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: Hello Martin, This is a fine example of the so-called is-ought controversy. The error message is indeed telling me exactly what the problem is, but the underlying problem is that this scheme was poorly thought out. Clearly

[issue12961] unlabelled balls in boxes

2011-09-12 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: Hello Mark, This is a fair question. Suppose that I have three boxes with capacity limits of 3, 2, and 1, and that there are three balls in total. Two of the possible distributions are the following: 2, 0, 1 2, 1, 0 Capacity

[issue12961] unlabelled balls in boxes

2011-09-12 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: Here's an example of a problem from an entirely different domain: An error control coding scheme can correct up to 3 errors in the header of a packet and up to one error in the body of a packet. A given message is divided

[issue10715] uninformative error message

2010-12-20 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: I eventually determined that a call to `subprocess.Popen` was responsible for the message, but could have determined this much more quickly if the message had included the name of the file that could not be opened (executed

[issue10715] uninformative error message

2010-12-20 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: Why was this removed? On Mon, Dec 20, 2010 at 8:30 PM, Alexander Belopolsky rep...@bugs.python.org wrote: Changes by Alexander Belopolsky belopol...@users.sourceforge.net: Removed file: http://bugs.python.org/file20125

[issue1859] textwrap doesn't linebreak on \n

2010-11-23 Thread Phillip M. Feldman
Phillip M. Feldman phillip.m.feld...@gmail.com added the comment: I would like to unsubscribe from this thread, but haven't been able to figure out how to do it. Phillip On Mon, Nov 22, 2010 at 11:50 PM, Georg Brandl rep...@bugs.python.orgwrote: Georg Brandl ge...@python.org added

[issue1859] textwrap doesn't linebreak on \n

2009-11-29 Thread Phillip M. Feldman
Phillip M. Feldman pfeld...@verizon.net added the comment: As a temporary workaround, you can use the `wrap` function in my strnum module (http://pypi.python.org/pypi/strnum/2.4). Phillip -- nosy: +pfeld...@verizon.net ___ Python tracker rep

[issue7411] allow import from file having name containing hyphen or blank

2009-11-29 Thread Phillip M. Feldman
New submission from Phillip M. Feldman pfeld...@verizon.net: It appears that there is currently no way to import from a file whose name contains a hyphen or blank. This makes it difficult to encode a version number or date in the file name. The solution that I favor would be to allow the name

[issue3079] sys.exit() called from optparse - bad, bad, bad

2009-10-15 Thread Phillip M. Feldman
Phillip M. Feldman pfeld...@verizon.net added the comment: The current behavior of optparse is contrary to how most of Python works. optparse should throw a named exception that can be trapped and identified by the calling program. Doing a SystemExit is unacceptable. I can't believe

[issue3079] sys.exit() called from optparse - bad, bad, bad

2009-10-15 Thread Phillip M. Feldman
Phillip M. Feldman pfeld...@verizon.net added the comment: Thanks for the response! I can indeed catch SystemExit, but I would like to be able to take one action (terminate the program) if the user supplied an unknown option, and another action (prompt for a new value) if the user supplied

[issue6663] re.findall does not always return a list of strings

2009-08-07 Thread Phillip M. Feldman
New submission from Phillip M. Feldman pfeld...@verizon.net: As per the Python documentation, the following regular expression should produce a list containing the strings '6.7', 7.33', and '9': re.findall('(-?\d+[.]\d+)|(-?\d+[.]?)|(-?[.]\d+)', 'asdf6.77.33ff9') Instead, it generates

[issue6663] re.findall does not always return a list of strings

2009-08-07 Thread Phillip M. Feldman
Phillip M. Feldman pfeld...@verizon.net added the comment: You are right-- the documentation does say this, although it took me a while to understand what it means. Thanks! It seems as though there's a flaw in the design here, because there should be some mechanism for grouping elements

[issue6652] missing cmath functions

2009-08-05 Thread Phillip M. Feldman
New submission from Phillip M. Feldman pfeld...@verizon.net: The online documentation describes functions cmath.phase and cmath.polar, but when I try to import these, I get cannot import name errors. -- assignee: georg.brandl components: Documentation messages: 91330 nosy: georg.brandl