[issue1009] Implementation of PEP 3101, Advanced String Formatting
Changes by Eric V. Smith: -- versions: +Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1009 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1009] Implementation of PEP 3101, Advanced String Formatting
Eric V. Smith added the comment: Closed, code was checked in revision 57444. -- versions: +Python 3.0 -Python 2.6 __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1009 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1009] Implementation of PEP 3101, Advanced String Formatting
Eric V. Smith added the comment: I tried to close it, without success. Possible tracker issue, I'll investigate. It should be closed! __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1009 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1158] %f format for datetime objects
Eric V. Smith added the comment: It's a nit, but there are a few other comments that should be changed to mention %f in addition to %z/%Z. * giving special meanings to the %z and %Z format codes via a preprocessing /* Scan the input format, looking for %z and %Z escapes, building /* percent followed by neither z nor Z */ -- nosy: +eric.smith __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1158 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1600] str.format() produces different output on different platforms (Py30a2)
Eric V. Smith added the comment: The PEP 3101 float formatting code (in Objects/stringlib/formatter.h) uses PyOS_ascii_formatd for all specifier codes except 'n'. So applying the patch would fix the issue that was originally brought up in msg58485. I think the approach of the patch (if not its content, I haven't inspected it yet) is correct. Fix the underlying code and benefit from this everywhere. I don't think we should change the tests to be more tolerant, I think we should be consistent across platforms. My only concern is breaking code in the wild. This seems like a change with wide-reaching implications. I think 'n' should also be addressed. It calls PyOS_snprintf directly. I'll review the patch and comment back here. Unfortunately, I don't have a Windows box set up for testing. __ Tracker [EMAIL PROTECTED] http://bugs.python.org/issue1600 __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11957] re.sub problem with unicode string
Eric V. Smith e...@trueblade.com added the comment: The 4th parameter to re.sub() is a count, not flags. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11957 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11967] Left shift and Right shift for floats
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11967 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1104] msilib.SummaryInfo.GetProperty() truncates the string by one character
Eric V. Smith e...@trueblade.com added the comment: This patch seems okay to me, as far as it goes. I'd like to hear Martin's feedback, but I think it should be committed. And I realize the rest of this message doesn't apply to the patch, but it does address other problems in summary_getproperty(). At least one of these led to the original problem with the truncated character. 1. It's not clear to me that the malloc() call only occurs if the type is VT_LPSTR. But that's the only case where free() is called. I think it would be better to move the call to free() to a cleanup section at the end of the function. 2. The status is never checked for success, just for one specific failure. I think both calls to MsiSummaryInfoGetProperty should be looking for ERROR_SUCCESS. 3. I don't think VT_FILETIME is special enough for its own error message. It should just be caught with all other unknown types. Maybe these last 3 should get their own new issue. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1104 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12004] PyZipFile.writepy gives internal error on syntax errors
Eric V. Smith e...@trueblade.com added the comment: Could you incorporate the test into Lib/test/test_zipfile? Thanks! -- components: +Library (Lib) nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12004 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: I haven't had time to completely review this, I will do so later today. But let me just say that the string is first parsed for replacement strings inside curly braces. There's no issue with that, here. Next, the string is parsed for conversion and format_spec, looking for ! and : respectively. In your first example that gives: field_name: '0[' conversion : ']' It then tries to parse the field_name and gives you the first error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: but makes me think that treating ! and : in the index field separately is definitely wrong. But it doesn't know they're in an index field when it's doing the parsing for ':' or '!'. It might be possible to change this so that the field name is fully parsed first, but I'm not sure the benefit would justify the effort. What's your use case where you need this feature? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: Note also that the nested expansion is only allowed in the format_spec part, per the documentation. Your last examples are attempting to do it in the field_name, which leads to the errors you see. Your very last example doesn't look right to me. I'll have to investigate why it's giving you that error message. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11072] Add MLSD command support to ftplib
Eric V. Smith e...@trueblade.com added the comment: Yes, I think this should be committed. I think the API is reasonable, which is the primary concern. If there are implementation bugs, they can be addressed as they're found. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11072 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12084] os.stat() on windows doesn't consider relative symlink
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, jaraco ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12084 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12127] Inconsistent leading zero treatment
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12127] Inconsistent leading zero treatment
Eric V. Smith e...@trueblade.com added the comment: I don't buy the confusion with other languages argument. It's a different language. People know that. I'd like to see leading zeros allowed for integer literals, but I don't feel strongly about it, so +0. I'd mainly use them for tables of numbers that I'd like to line up. If using 2to3 or 3to2, they could deal with it. The only case it would cause you problems is code that you want to run unchanged in 2.x and 3.x. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12127 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12185] Decimal documentation lists first and second arguments, should be self and other
New submission from Eric V. Smith e...@trueblade.com: http://docs.python.org/library/decimal.html In 9.4.2, Decimal objects, some of the methods mention the first and second parameters, when really it should be self and the argument, usually named other and sometimes something more specific. These include: compare_total copy_sign next_toward quantize (argument is exp) rotate scaleb shift It looks this is left over from where the same-named functions are described in the Context objects section. -- assignee: docs@python components: Documentation messages: 136947 nosy: docs@python, eric.smith priority: normal severity: normal status: open title: Decimal documentation lists first and second arguments, should be self and other versions: Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12185 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12188] PEP 7, C style: add ++ policy and explanation
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12188 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12191] Shutil - add chown() in order to allow to use user and group name (and not only uid/gid)
Eric V. Smith e...@trueblade.com added the comment: As a new feature, it can't be added to 2.7. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12191 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12185] Decimal documentation lists first and second arguments, should be self and other
Eric V. Smith e...@trueblade.com added the comment: I'm not talking about the method itself but rather the descriptive text. For example: copy_sign(other) Return a copy of the first operand with the sign set to be the same as the sign of the second operand. There is no second operand, unless you consider self the first and other the second. Which of course is true inside the method, but it reads oddly as a description of the method from the outside. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12185 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: PEP 3101 defines format strings as intermingled character data and markup. Markup defines replacement fields and is delimited by braces. Only after markup is extracted does the PEP talk about interpreting the contents of the markup. So, given {0[a}b]} the parser first parses out the character data and the markup. The first piece of markup is {0[a}. That gives a syntax error because it's missing a right bracket. I realize you'd like the parser to find the markup as the entire string, but that's not how I read the PEP. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: The intermingling of character data and markup is far from irrelevant: that's exactly what str.format() does! I don't see how it can be irrelevant to a discussion of how the string is parsed. Note that there are no restrictions, in general, on what's in a format specifier. Braces can be in format specifiers, if they make sense for that type. For example: from datetime import datetime format(datetime.now(), '{}%Y-%m-%d}{') '{}2011-06-03}{' It's definitely true that you can have valid format specifiers that cannot be represented in strings parsed by str.format(). The PEP talks about both format specifiers in the abstract (stand alone) and format specifiers contained in str.format() strings. The current implementation of str.format() finds matched pairs of braces and call what's inside markup, then parse that markup. This indeed restricts what's inside the markup. I believe the implementation is compliant with the PEP. It's also true that other interpretations of the PEP are possible. I'm just not sure the benefit to be gained justifies changing all of the extant str.format() implementations, in addition to explaining the different behavior. Many useful features for str.format() were rejected in order to keep the implementation and documentation simple. I'm not saying change and improvement is impossible. I'm just not convinced it's worthwhile. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13143] os.path.islink documentation is ambiguous
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, jason.coombs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13143 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13271] When -h is used with argparse, default values that fail should not matter
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +bethard, eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13271 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13314] ImportError ImportError: Import by filename, should be deferred until sys.meta_path hooks are processed
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13314 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13321] fstat doesn't accept an object with fileno method
Eric V. Smith e...@trueblade.com added the comment: If I understand it correctly, this change request is to change os.fstat(obj) (and probably other functions) to call obj.fileno(), instead of the caller doing that? If so, -1. Keep os.fstat() as a thin wrapper around fstat. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13321 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13385] Add an explicit re.NOFLAGS flag value to the re module
Eric V. Smith e...@trueblade.com added the comment: Since the flags are OR'd together, I don't see what other value the no flags parameter could have, other than zero. That said, I don't feel strongly about it, and if it helps readability I'm not opposed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13385 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13386] Document documentation conventions for optional args
Eric V. Smith e...@trueblade.com added the comment: To your last point, I think it's important to specify the default value placeholder (basically a sentinel) in the documentation. For example, if a function takes -1 to mean all occurrences, then the caller needs to know how what value to pass in in order to let the function compute the value. This is especially true if it's cheaper for the function to compute the value instead of the caller. I've run into this problem before, where I wanted to pass in some sentinel value and I had to read the source to figure out what it was. I think the function was in the standard library, but now I can't recall what it was. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13410] String formatting bug in interactive mode
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13412] No knowledge of symlinks on Windows
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, jason.coombs ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13412 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13410] String formatting bug in interactive mode
Eric V. Smith e...@trueblade.com added the comment: I think this must be a change between 2.5 and 2.6. In 2.5.1 non-debug (Linux) I consistently see: print '%d' % y Traceback (most recent call last): File stdin, line 1, in module TypeError: int argument required In 2.6.5 (Windows via activestate) I see the alternating errors reported here. In 2.7.2+ debug (Linux) I consistently see: print '%d' % y 22 XXX undetected error Traceback (most recent call last): File stdin, line 1, in module TypeError: int() argument must be a string or a number, not 'Foo' [38749 refs] Note the XXX undetected error. In 2.7.2+ non-debug (Linux), I get the alternating errors reported here. I don't think anything will be done about the problem in 2.6. For 2.7, the XXX undetected error should be investigated, and will likely point to the problem. -- assignee: ronaldoussoren - components: +Interpreter Core -Macintosh versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13410] String formatting bug in interactive mode
Eric V. Smith e...@trueblade.com added the comment: I don't think you're going to want those print statements in a test. You could just evaluate '%d' % y. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13410] String formatting bug in interactive mode
Eric V. Smith e...@trueblade.com added the comment: With an unpatched 2.7, this fails for me: diff --git a/Lib/test/test_format.py b/Lib/test/test_format.py --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -289,6 +289,17 @@ else: raise TestFailed, '%*d%(maxsize, -127) should fail' +def test_issue13410(self): +class Foo(object): +def __init__(self, x): +self.x = x +def __long__(self): +return long(self.x) +def __float__(self): +return float(self.x) +'%d' % Foo(22) + def test_main(): test_support.run_unittest(FormatTest) $ ./python Lib/test/regrtest.py test_format test_format test test_format crashed -- type 'exceptions.TypeError': int() argument must be a string or a number, not 'Foo' 1 test failed: test_format -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13410] String formatting bug in interactive mode
Eric V. Smith e...@trueblade.com added the comment: Interesting! Same here. Using eval() fails with or without -v: --- a/Lib/test/test_format.py +++ b/Lib/test/test_format.py @@ -289,6 +289,18 @@ else: raise TestFailed, '%*d%(maxsize, -127) should fail' +def test_issue13410(self): +class Foo(object): +def __init__(self, x): +self.x = x +def __long__(self): +return long(self.x) +def __float__(self): +return float(self.x) +eval(u'%d' % Foo(22)) +eval('%d' % Foo(22)) + + def test_main(): test_support.run_unittest(FormatTest) I've put both '%d' and u'%d' here, but it also fails with just one of them. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13410 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13386] Document documentation conventions for optional args
Eric V. Smith e...@trueblade.com added the comment: I just ran across the other reason that having the actual default values documented is important. Sometimes I want to do this: some_func(param if some_condition else use the default value) If some_condition is False, I want the default behavior, if not, I want to pass in a parameter. If I don't know the real default value, I have to write: if some_condition: some_func(param) else: some_func() -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13386 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13433] String format documentation contains error regarding %g
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13433 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10621] 1 + 2j -- (1 + 2j) and not (1+2j)
Eric V. Smith e...@trueblade.com added the comment: I'm not sure why this is being reopened. Unless there's been a discussion I'm not aware of, the change is still not worth the disruption it would cause. And in any event, it can only be addressed in new (as yet unreleased) versions of python. It would never be implemented in any release before 3.3. -- resolution: remind - wont fix status: open - closed versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10621] 1 + 2j -- (1 + 2j) and not (1+2j)
Eric V. Smith e...@trueblade.com added the comment: I'm -1 on this change. I think all the core devs who have commented on it here are -1 or -0. If you really want to lobby for this change, I suggest starting a discussion on python-dev. My position is that I think it would indeed look nicer, but the breakage doesn't justify the small improvement. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10621 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13450] add assertions to implement the intent in ''.format_map test
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13450 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13450] add assertions to implement the intent in ''.format_map test
Eric V. Smith e...@trueblade.com added the comment: I don't think the existing tests have any value. I might leave one of them, but I think I'll just use your new tests instead. akira: I'd like to add your name to the Misc/ACKS file, if it's not already there. What's your full name? Thanks for the bug report and patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13450 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13535] Improved two's complement arithmetic support: to_signed() and to_unsigned()
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13535 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13579] string.Formatter doesn't understand the !a conversion specifier
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - eric.smith nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13579 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13598] string.Formatter doesn't support empty curly braces {}
Eric V. Smith e...@trueblade.com added the comment: This bug is assigned to me. Sometimes it takes a while before a committer has time to review a bug and act on it. I can assure you that I will review this before the next release of Python. Thank you for the bug report, and especially thanks for the patch! One thing that will definitely need to be developed before this is committed is one or more tests. Either you can add them, or I will before I commit the fix. There are some existing tests for str.format that can be leveraged for string.Formatter. -- stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13598 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13685] argparse does not sanitize help strings for % signs
Eric V. Smith e...@trueblade.com added the comment: This is because the help text support substitution, as mentioned here: http://docs.python.org/dev/library/argparse.html#help It's possible this documentation could be improved. -- assignee: - docs@python components: +Documentation -None nosy: +docs@python, eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13685 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13685] argparse does not sanitize help strings for % signs
Eric V. Smith e...@trueblade.com added the comment: In case I wasn't clear, I mean that the help string supports %-formatting variable expansion, such as %(default)s. I think it would be good if a sentence were added to the end of the help section, saying something like: Because the help string supports %-formatting, if you want a literal % to appear in the help string, you must escape it as %%. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13685 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13706] non-ascii fill characters no longer work in numeric formatting
Eric V. Smith e...@trueblade.com added the comment: I assume this is left over from the PEP 393 changes. I think the right thing to do is delete this code from line 277 of formatter_unicode.c: if (format-fill_char 127 || format-align 127 || format-sign 127) { PyErr_SetString(PyExc_ValueError, fill character too large); return 0; } I'm not sure such a restriction needs to exist any more. But I'll admit to not having thought it through. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13706 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13718] Format Specification Mini-Language does not accept comma for percent value
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13718 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13742] Add a key parameter (like sorted) to heapq.merge
Changes by Eric V. Smith e...@trueblade.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13742 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13718] Format Specification Mini-Language does not accept comma for percent value
Eric V. Smith e...@trueblade.com added the comment: Good point. I hadn't looked at the string closely enough. Closing. -- resolution: - invalid stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13718 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13755] str.endswith and str.startswith do not take lists of strings
Eric V. Smith e...@trueblade.com added the comment: It seems like a set would make more sense than a tuple. And if tuples, why not lists? Not that it matters much, since I doubt it's worth changing in either case. It's easy enough for the caller to convert. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13755 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13776] formatter_unicode.c still assumes ASCII
Eric V. Smith e...@trueblade.com added the comment: This is a duplicate of issue 13706. -- nosy: +eric.smith resolution: - duplicate stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13776 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13706] non-ascii fill characters no longer work in formatting
Eric V. Smith e...@trueblade.com added the comment: Sorry for the off-the-cuff diagnosis. I had assumed this was the unintended result of the conversion, but of course I'm wrong. I'd like to fix this. -- nosy: +Jim.Jewett ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13706 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13790] In str.format an incorrect error message for list, tuple, dict, set
Eric V. Smith e...@trueblade.com added the comment: I agree it's not the best error message. What's happening is that these types (list, tuple, etc.) do not implement __format__, so object.__format__ is used. It returns str(self). Then the resulting string is formatted with the given format_spec. Since str does not support the 'd' format type, the error you see is raised. I'm open to suggestions on how to improve this, but I don't see how it's possible given what str.__format__ knows when it generates the error. -- assignee: - eric.smith nosy: +eric.smith versions: +Python 3.2, Python 3.3 -Python 3.1 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13790] In str.format an incorrect error message for list, tuple, dict, set
Eric V. Smith e...@trueblade.com added the comment: Changing to a documentation issue. -- assignee: eric.smith - docs@python components: +Documentation -Interpreter Core keywords: +easy nosy: +docs@python versions: +Python 2.7 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Eric V. Smith e...@trueblade.com added the comment: What is the expected output, and why? I think the error message might be incorrect, possibly it should be invalid format specifier. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Eric V. Smith e...@trueblade.com added the comment: I'm not sure what you're saying here. Is it that 'xx' should be ignored? The documentation says that 'xx' isn't fill and alignment, not that they don't exist. If they're not fill and alignment, then the format string is in error. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format an incorrect alignment option doesn't make fill char and onself absent
Eric V. Smith e...@trueblade.com added the comment: The only error is the text of the ValueError. I'll look into fixing that. These characters will not be ignored. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.
Eric V. Smith e...@trueblade.com added the comment: Changing to 3.3: I don't think applying this to 3.2 would be appropriate. -- assignee: - eric.smith keywords: +easy priority: normal - low stage: - needs patch title: In str.format an incorrect alignment option doesn't make fill char and onself absent - In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading. versions: +Python 3.3 -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.
Eric V. Smith e...@trueblade.com added the comment: As I look at it a little closer, I think I'm going to change the message to: Invalid format type specified. The code has determined that instead of a type that's a single character long, it's received xx10d. That's because xx doesn't match any of [[fill]align][sign][#][0][width][,][.precision], so it must be the [type] field. I'm open to a better message, though. Due to the variable width chars in the format_spec string, include the xx10d along with the error text is a little complicated. But maybe including it would be an improvement: Invalid format type 'xx10d' found, expected a single character. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13811] In str.format, if invalid fill and alignment are specified, the text of the ValueError message is misleading.
Eric V. Smith e...@trueblade.com added the comment: The existing exceptions use the text format code for what the documentation calls type: format(9, h) Traceback (most recent call last): File stdin, line 1, in module ValueError: Unknown format code 'h' for object of type 'int' So to be consistent, it should say: format(9, xx10f) Traceback (most recent call last): File stdin, line 1, in module ValueError: Invalid format code -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13811 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13790] In str.format an incorrect error message for list, tuple, dict, set
Eric V. Smith e...@trueblade.com added the comment: I don't think {} is the correct way to document this. These all have an empty format specifier: {}.format(foo) {:}.format(foo) {0}.format(foo) {0:}.format(foo) {name}.format(name=foo) format(foo, ) format(foo) That is, they all call foo.__format__(). If foo.__format__ (well, really type(foo).__format__) doesn't exist, then object.__format__(foo, ) gets called. It's object.__format__ that's checking for the empty format string, and if so it returns str(foo). What would you suggest changing the ':d' error message to, for objects that don't support a format type of 'd'? This makes sense to me: format('', 'd') Traceback (most recent call last): File stdin, line 1, in module ValueError: Unknown format code 'd' for object of type 'str' The problem, if there is one, is: format([], 'd') Traceback (most recent call last): File stdin, line 1, in module ValueError: Unknown format code 'd' for object of type 'str' The problem is that the str that's producing this error doesn't know that it exists because object.__format__ returned str([]). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13790] In str.format an incorrect error message for list, tuple, dict, set
Eric V. Smith e...@trueblade.com added the comment: While looking at object.__format__, I recall that we've already addressed this, sort of. For a different reason, this is already deprecated in 3.3 and will become an error in 3.4. See issues 9856 and 7994. $ ./python -Wd Python 3.3.0a0 (default:40e1be1e0707, Jan 15 2012, 00:58:51) [GCC 4.6.1] on linux Type help, copyright, credits or license for more information. format([], 'd') __main__:1: DeprecationWarning: object.__format__ with a non-empty format string is deprecated Traceback (most recent call last): File stdin, line 1, in module ValueError: Unknown format code 'd' for object of type 'str' [67288 refs] We could still have object.__format__ catch and re-throw the ValueError with a better message. I'd have to think it through if we could catch all ValueErrors, or if it's possible for another ValueError to be thrown and we'd only catch and rethrow this specific ValueError. But since this is deprecated, I'm not sure it's worth the hassle. I'd advocate closing this issue as won't fix. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13790] In str.format an incorrect error message for list, tuple, dict, set
Eric V. Smith e...@trueblade.com added the comment: The error message will be: non-empty format string passed to object.__format__. I agree with your comment about Terry's patch. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13790 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13838] In str.format {0:#.5g} for decimal.Decimal doesn't print trailing zeros
Eric V. Smith e...@trueblade.com added the comment: See issue #7098 for a discussion. I propose to close this issue. -- nosy: +eric.smith, mark, skrah ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13838 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13838] In str.format {0:#.5g} for decimal.Decimal doesn't print trailing zeros
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +mark.dickinson -mark ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13838 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13838] In str.format {0:#.5g} for decimal.Decimal doesn't print trailing zeros
Changes by Eric V. Smith e...@trueblade.com: -- resolution: - duplicate status: open - closed superseder: - Add alternate float formatting styles to new-style formatting. ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13838 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13889] str(float) and round(float) issues with FPU precision
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13889 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13882] Add format argument for time.time(), time.clock(), ... to get a timestamp as a Decimal object
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13882 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13922] argparse handling multiple -- in args improperly
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +bethard, eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13922 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13927] Extra spaces in the output of time.ctime
Eric V. Smith e...@trueblade.com added the comment: That's definitely the expected behavior. It's the same as the C library version of ctime(). But I couldn't find it documented in the Python docs, so I'm changing this to a documentation issue. Thanks for the report. -- assignee: - docs@python components: +Documentation -None nosy: +docs@python, eric.smith versions: +Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13927 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11122] bdist_rpm should use rpmbuild, not rpm
Eric V. Smith added the comment: I agree on just switching to rpmbuild, at least for 3.4. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11122 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16675] Ship Python with a package manager
Eric V. Smith added the comment: Because this is a new feature, it could only be added to Python 3.4. Changing versions. -- components: +Installation nosy: +eric.smith type: behavior - enhancement versions: -Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16675 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9856] Change object.__format__(s) where s is non-empty to a TypeError
Eric V. Smith added the comment: The more I think about this, the more overly restrictive I realize it is. If the type of the object really is object, then it can use string formatting. It's only for non-objects that I want to add the error. I'll re-open it and give it some more thought. -- resolution: fixed - stage: committed/rejected - status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9856 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7300] Unicode arguments in str.format()
Eric V. Smith added the comment: I agree that we should close this as won't fix in 2.7. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7300 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16047] Tools/freeze no longer works in Python 3
Eric V. Smith added the comment: What Barry said. :) I haven't had time to check yet: but why does site.py need the __file__ attribute? Maybe that's the actual problem. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16047 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16944] German number separators not working using format language and locale de_DE
Eric V. Smith added the comment: I think this issue should be closed, since we're doing as we're instructed by the OS. If someone wants to open a new issue for the m format specifier type, I'd support that. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16944 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16977] argparse: mismatch between choices parsing and usage/error message
Eric V. Smith added the comment: Isn't this really just an inappropriate use of a string instead of a list? If indeed this is in the documentation, it should be changed. I still don't like: p.add_argument('a', choices=list('abc')) but at least it would work. This call to list() could be done internally, but I think passing in a string is a bad practice and argparse should not contain internal workarounds to cater to this usage. If you're proposing that argparse should use sequence iteration instead of the in operator, I disagree with that solution. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16977 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17005] Add a topological sort algorithm
Eric V. Smith added the comment: +1 I'll note (by inspection only) your example code doesn't work under Python 3.x! :) (print as a statement) -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17005 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3982] support .format for bytes
Eric V. Smith added the comment: I think ''.join() will always be faster than ''.format(), for a number of reasons (some already stated): - it doesn't have to pass the format string - it doesn't have to do the __format__ lookup and call the resulting function (although I believe there's an optimization for str) - it doesn't have to consider the conversion and formatting steps Whether b''.format() would have to lookup and call __format__ remains to be seen. From what I've read, maybe baking in knowledge of bytes, float, and int would be good enough. I suspect there might be some need for datetimes, but I could be wrong. The above said, code using b''.format() would definitely be easier to write and understand that a lot of individual field formatting followed by a .join(). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3982] support .format for bytes
Eric V. Smith added the comment: I retract the datetime comment. Given what we're trying to accomplish, I think we only need to support types that are supported by 2.7's %-formatting. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue3982] support .format for bytes
Eric V. Smith added the comment: So it sounds like the use case is (as Glyph said in msg180432): - Provide a transition for users of 2.7's of str %-formatting into a style that's compatible with both str in 2.7 and bytes in 3.4. In that case the only options I see are to implement __mod__ or .format for bytes in 3.4. I'd of course prefer to use .format, although __mod__ would probably make the transition easier (no need to move to .format first). It would probably also make the implementation easier, since there's so much less code in str.__mod__. But let's assume we're using .format [1]. Given the restricted use case, and assuming we using .format, the implementation would not need to support: - Types other than bytes, int, float. - Subclasses of these types with custom formatting. - !s, !r, or !a (none of the ! conversions). [2] But it would support all of the specifiers for formatting strs (except now for bytes), floats, and ints. I haven't looked through the str.format or {str,int,float}.__format__ code since the PEP 393 work, so I'm not really sure if we could stringlib-ify the code again, or if it would just be easier to reimplement it as separate bytes-only code. [1] It's open for debate whether .format or .__mod__ is preferable. [2] Since %-formatting supports %r and %s, this point is arguable. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue3982 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17174] Posix os.path.join should raise TypeError when passed unusable type
Eric V. Smith added the comment: I think this change should not be made: it's a slippery slope, because there are thousands of places in the stdlib where a similar change could be made. It's the nature of duck typing that you're not going to get a great error message everywhere you pass in the wrong type. Python programmers just have to learn this and understand it's a source of sometimes unobvious error messages. If, despite my concerns, this change is still made, I think it is important that any new error message not mention str, or any list of accepted types. The proposal in msg181762 is good enough: just say that whatever type was used isn't acceptable. For example: there are a number of path object proposals floating around, and it's possible one of those could be used with os.path.join despite it not being a str. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17174 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue4591] 32-bits unsigned user/group identifier
Eric V. Smith added the comment: +1 for PyIndex_AsLong() -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4591 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14905] zipimport.c needs to support namespace packages when no 'directory' entry exists
Eric V. Smith added the comment: I don't think such files are common: I've never seen such a file in the wild. I created one, by accident, while testing PEP 420. OTOH, it was surprisingly easy to create the malformed file with zipfile. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14905 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17247] int and float should detect inconsistent format strings
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17247 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17259] locale.format() rounding is not reliable for floats
Eric V. Smith added the comment: Mark is the ultimate authority here, but my recollection is (and a quick scan of the code shows) that half to even rounding is used in all of our float to string conversions. So that includes %f and float.__format__, among others. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17267] datetime.time support for '+' and 'now'
Eric V. Smith added the comment: What would this give: tm = datetime.time(13, 20) later = tm + datetime.timedelta(hours=47, minutes=44) datetime.time(13, 4)? Or raise an exception? I've thought about this before, but it's always a problem when going over date boundaries. If you define + to be modulo 24 hours, then it's not very useful for cases I've looked at. Every time I've used time by itself, I end up going back to datetime. But I'll admit that might be a shortcoming of mine, not the concept. -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17267 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17259] Document round half to even rule for floats
Eric V. Smith added the comment: I've just looked through the code for 2.7. It uses short float repr for both %-formatting and for float.__format__. So they both use Gay's code, and both should work the same as they do in 3.2+. In all cases, round-half-to-even is used. It's 2.6 that uses the C library to do float formatting (for both %-formatting and float.__format__). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17259 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17280] path.basename and ntpath.basename functions returns an incorrect file name in Windows 7
Changes by Eric V. Smith e...@trueblade.com: -- stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17280 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17292] Autonumbering in string.Formatter doesn't work
Eric V. Smith added the comment: This is a duplicate of issue 13598. I'll add you to nosy over there. -- resolution: - duplicate stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17292 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13598] string.Formatter doesn't support empty curly braces {}
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +binkert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13598 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17336] Complex number representation round-trip doesn't work with signed zero values
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17336 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9334] argparse does not accept options taking arguments beginning with dash (regression from optparse)
Eric V. Smith added the comment: Evgeny: I completely agree. It's unfortunate that argparse doesn't work that way. However, I think it's too late to change this behavior without adding a new parser. I don't think existing argparse can be changed to not operate the way it does, due to backward compatibility concerns. The discussion in this issue describes those compatibility concerns. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue9334 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17457] Unittest discover fails with namespace packages and builtin modules
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17457 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: From the PEP: Format strings consist of intermingled character data and markup. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: d = {{0}: spam} # a matched pair of braces. What's inside is considered markup. ... {0}.format(d) {'{0}': 'spam'} # a matched pair of braces. Inside is a matched pair of braces, and what's inside of that is not considered markup. I'm not sure what' you're getting at. {0} (which is indeed markup) is replaced by str(d), which is {'{0}': 'spam'}. ... {0[{0}]}.format(d) 'spam' Again, I'm not sure what you're getting at. The inner {0} is not interpreted (per the PEP). So the entire string is replaced by d['{0}'], or 'spam'. Let me try to explain it again. str.format() parses the string, looking for matched sets of braces. In your last example above, the very first character '{' is matched to the very last character '}'. They match, in sense that all of the nested ones inside match. Once the markup is separated from the character data, the interpretation of what's inside the markup is then done. In this example, there is no character data. I apologize if I'm explaining this poorly. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12014] str.format parses replacement field incorrectly
Eric V. Smith e...@trueblade.com added the comment: We're going to have to agree to disagree. I believe that {0[}]} is the markup {0[} followed by the character data ]}. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12188] PEP 7, C style: add ++ policy and explanation
Eric V. Smith e...@trueblade.com added the comment: But don't you think we should put information like this somewhere, even if it's not in PEP 7? We've had a discussion about this particular issue (idiomatic pointer increments when appending to a buffer) at least twice, and there's also the recent if (const == variable) issue that feels similar to me. It seems to me that recording these decisions somewhere has value, just so we don't have to revisit them. -- status: pending - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12188 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12342] characters with ord above 65535 fail to display in IDLE
Changes by Eric V. Smith e...@trueblade.com: -- nosy: +eric.smith ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12342 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com