Changes by Eric V. Smith:
--
versions: +Python 2.6
__
Tracker [EMAIL PROTECTED]
http://bugs.python.org/issue1009
__
___
Python-bugs-list mailing list
Unsubscribe:
http
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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 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
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
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
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
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
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
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
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
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
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
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
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
Changes by Eric V. Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13450
___
___
Python-bugs
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
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
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
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
Changes by Eric V. Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12014
___
___
Python-bugs
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
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
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
Changes by Eric V. Smith e...@trueblade.com:
--
assignee: - eric.smith
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13718
___
___
Python-bugs
Changes by Eric V. Smith e...@trueblade.com:
--
assignee: - rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13742
___
___
Python-bugs
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +mark.dickinson -mark
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13838
___
___
Python
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
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +eric.smith, mark.dickinson
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13889
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
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
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
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
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
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
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
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
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
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
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
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
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
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__
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
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
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
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
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
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
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
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
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
Changes by Eric V. Smith e...@trueblade.com:
--
nosy: +binkert
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13598
___
___
Python-bugs-list
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
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
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
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
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
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
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
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
1 - 100 of 2689 matches
Mail list logo