This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: clean up new calendar locale usage
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: doerwalter Nosy List: doerwalter, nnorwitz
Priority: normal Keywords: patch

Created on 2006-04-03 03:21 by nnorwitz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cal.diff nnorwitz, 2006-04-03 03:21 v1 - using with for handling locale
Messages (2)
msg49947 - (view) Author: Neal Norwitz (nnorwitz) * (Python committer) Date: 2006-04-03 03:21
Walter,

I don't know if this is really better or not.  I was
wondering if the new with statement would help cleanup
the locale handling (all the try-finallys).  It reduces
the total lines of code a little bit.  It seems a
little cleaner to me.  I didn't see any tests for the
new classes, so I only tested on the command line and
it seemed to work.  Regardless of whether you like this
patch or not, it would be good to add tests for the new
classes in calendar.

I'm probably about +0 on this patch.  It was more an
experiment to see if the code was clearer.  I think
it's marginally better at most.
msg49948 - (view) Author: Walter Dörwald (doerwalter) * (Python committer) Date: 2006-04-12 10:13
Logged In: YES 
user_id=89016

Since there's now backwards compatibility issue, and the
code *does* read a littler better and the stdlib should be
an example of Python usage, I checked in your patch as
r45302 with added tests for TextCalendar and HTMLCalendar. I
don't know how we could add reliable tests for
LocaleTextCalendar and LocaleHTMLCalendar.
History
Date User Action Args
2022-04-11 14:56:16adminsetgithub: 43149
2006-04-03 03:21:35nnorwitzcreate