[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Ezio Melotti
Ezio Melotti added the comment: Fixed, thanks for the patch! -- assignee: docs@python -> ezio.melotti resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed type: behavior -> enhancement ___ Python tracker

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Roundup Robot
Roundup Robot added the comment: New changeset 40f582a73901 by Ezio Melotti in branch '3.3': #8913: add examples and docs for date/time/datetime.__format__. Patch by Heikki Partanen. http://hg.python.org/cpython/rev/40f582a73901 New changeset 8dd7f7134700 by Ezio Melotti in branch 'default': #

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Heikki Partanen
Heikki Partanen added the comment: The examples in the previous patches were trying to show some "real-worldish" use cases, but I admit that they don't fit in that well to the existing examples shown in the docs. The new examples Ezio suggested are more straightforward and better in line with

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Ezio Melotti
Ezio Melotti added the comment: I left another review with a couple of suggestions. The patch is OK, it's just that the examples look a bit meaningless to me. -- stage: -> patch review versions: +Python 3.4 -Python 3.2 ___ Python tracker

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Eric V. Smith
Eric V. Smith added the comment: That looks great. Thanks! -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: ht

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-03 Thread Heikki Partanen
Heikki Partanen added the comment: Improved the datetime example to have time part -- Added file: http://bugs.python.org/file29663/issue8913-4.patch ___ Python tracker ___ ___

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-02 Thread Eric V. Smith
Eric V. Smith added the comment: My only suggestion would be that the datetime example would be better if it actually used a time portion, similar to the strftime example above it. Otherwise, it looks good. -- ___ Python tracker

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-02 Thread Éric Araujo
Éric Araujo added the comment: Ezio, you are the latest reviewer, do you have outstanding comments? -- ___ Python tracker ___ ___ Pytho

[issue8913] Document that datetime.__format__ is datetime.strftime

2013-04-01 Thread Mark Lawrence
Mark Lawrence added the comment: Can issue8913-3.patch be committed or are any further tweaks needed? -- nosy: +BreamoreBoy ___ Python tracker ___

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-11-05 Thread Eric V. Smith
Eric V. Smith added the comment: To Heikki Partanen excellent point in the review about date __format__ strings allowing you to combine date formatting with other types of formatting: This is a great point. It's the lack of this that (for example) requires the logging module to have a separate

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-29 Thread Heikki Partanen
Heikki Partanen added the comment: Grammar fixed -- Added file: http://bugs.python.org/file27791/issue8913-3.patch ___ Python tracker ___ _

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-29 Thread Heikki Partanen
Heikki Partanen added the comment: Thanks for the comments, Eric! I reworded the docs and improved the examples too (being stuck in 2.6 I didn't even know about the cool autonumbering :) -- Added file: http://bugs.python.org/file27782/issue8913-2.patch

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-24 Thread Ezio Melotti
Changes by Ezio Melotti : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyt

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-24 Thread Andrew Svetlov
Changes by Andrew Svetlov : -- nosy: +asvetlov ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-23 Thread Éric Araujo
Éric Araujo added the comment: Thanks! Reviewed. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-10-23 Thread Heikki Partanen
Heikki Partanen added the comment: Added documentation for __format__ for datetime, time and date, and also added example code for using string.format. Seemed to merge cleanly to 3.4 and 2.7. -- keywords: +patch nosy: +heikki.partanen Added file: http://bugs.python.org/file27684/issue89

[issue8913] Document that datetime.__format__ is datetime.strftime

2012-01-16 Thread Éric Araujo
Éric Araujo added the comment: IMO, now that two official releases of Python 3 have shipped with this behavior (3.1 and 3.2), it is too late to think about changing what datetime.__format__ does, and we should merely document that it is the same as strftime. -- __

[issue8913] Document that datetime.__format__ is datetime.strftime

2011-11-16 Thread Florent Xicluna
Changes by Florent Xicluna : -- type: -> behavior versions: +Python 3.3 -Python 2.6, Python 3.1 ___ Python tracker ___ ___ Python-bugs

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-10-04 Thread Eric Smith
Eric Smith added the comment: I'm okay with that. Grepping Lib shows that date/datetime/time and Decimal are the only types that implement __format__. Decimal largely implements the same language as float. -- ___ Python tracker

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-10-04 Thread R. David Murray
R. David Murray added the comment: Alexander closed issue 7789 in favor of this one, which is fine, but I want to respond to Eric's rejection there of including info about datetime in the 'format mini language' section of the docs. His point was that only the builtin types were documented th

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-09-09 Thread Florent Xicluna
Changes by Florent Xicluna : -- nosy: +flox ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.o

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Éric Araujo
Éric Araujo added the comment: I think this particular wheel has one very good reinvention as the Locale Data Markup Language specification. Example from the Python Babel package: >>> format_datetime(dt, "y..dd GGG hh:mm a", locale='en') u'02007.April.01 AD 03:30 PM' http://unicode.or

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Eric Smith
Eric Smith added the comment: Unfortunately I think it's too late to do anything about this. I, for one, have many lines of code in production that use the strftime format specifier for datetime.__format__. You only option would be to invent a new language that was somehow distinguishable fr

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: The problem I have with strftime %-format codes is that according to BSD manual page they have already ran out of English alphabet and still "there is no conversion specification for the phase of the moon." :-) On a serious note, there are no codes to f

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Eric Smith
Eric Smith added the comment: This documentation should also be added for datetime.time and datetime.date, in addition to datetime.datetime. -- ___ Python tracker ___ __

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Eric Smith
Eric Smith added the comment: I think Alexander's example is best written as: "Today is: {0:%a %b %d %H:%M:%S %Y}".format(datetime.now()) I agree with Brett that there's nothing unusual about having type-specific formatting languages, and for datetime strftime is the obvious choice. It's a li

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-06 Thread Brett Cannon
Brett Cannon added the comment: I don't find it odd at all that you use datetime-specific formats instead of integral formats to get numbers out of a datetime object; they are totally different things. And one of the reasons for __format__ support is to have DSLs such as the one for datetime

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-05 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: I wonder if this is subject to change. I find it odd that >>> "{:g}".format(1e3) '1000' but one has to use % in >>> "{:%Y}".format(datetime.now()) '2010' It is also different from PEP 3101 recommendation: """ An example is the 'datetime' class,

[issue8913] Document that datetime.__format__ is datetime.strftime

2010-06-05 Thread Brett Cannon
New submission from Brett Cannon : Documenting that would help get people using datetime objects with string.format more. -- assignee: d...@python components: Documentation keywords: easy messages: 107179 nosy: brett.cannon, d...@python priority: low severity: normal status: open title: