classification
Title: Unused Superclass in calendar.py
Type: Stage: resolved
Components: Library (Lib), Tests Versions: Python 3.5
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: CliffM, Vipul.Sharma, berker.peksag, serhiy.storchaka
Priority: normal Keywords: easy, patch

Created on 2015-01-22 21:46 by CliffM, last changed 2015-02-28 17:04 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
calendar_1.patch Vipul.Sharma, 2015-01-28 14:45 review
Messages (4)
msg234513 - (view) Author: CliffM (CliffM) Date: 2015-01-22 21:46
calendar.py ( lines 17,18 )  is not used :

# Exception raised for bad input (with string parameter for details)
error = ValueError

This could either be deleted OR used as the superclass in the next two class declarations as the comment suggests.
msg234895 - (view) Author: Vipul Sharma (Vipul.Sharma) * Date: 2015-01-28 14:45
I am submitting a patch file, hope this works. Please review it and correct me if I am wrong anywhere as this is my first contribution.
msg234915 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-01-28 21:27
Looks like "error" was unused since https://hg.python.org/cpython/rev/acdc0b9a6c78#l2.48 (see also  https://hg.python.org/cpython/rev/6ee380349c84/ for time.gmtime()). LGTM.
msg234917 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-01-28 21:53
I suppose that calendar.error is here for compatibility. It is an alias to ValueError, so that errors raised by the calendar module can be catched with the "except calendar.error:" statement. Making calendar.error different class will likely break user code. I am inclined to reject this patch.
History
Date User Action Args
2015-02-28 17:04:44berker.peksagsetstage: commit review -> resolved
2015-02-28 09:22:10serhiy.storchakasetstatus: open -> closed
resolution: not a bug
2015-01-28 21:53:03serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg234917
2015-01-28 21:27:12berker.peksagsetnosy: + berker.peksag

messages: + msg234915
stage: commit review
2015-01-28 14:45:16Vipul.Sharmasetfiles: + calendar_1.patch

nosy: + Vipul.Sharma
messages: + msg234895

keywords: + patch
2015-01-22 22:00:42SilentGhostsetkeywords: + easy
versions: + Python 3.5, - Python 3.6
2015-01-22 21:46:50CliffMcreate