Python Forum
what type of exception to use?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
what type of exception to use?
#4
any and every case of using foo=notNone and also using bar=notNone needs to raise this exception. if only one of them is used then this conflict is avoided but it could instead have a genuine TypeError or ValueError if the one value passed is a bad type or bad value. it is not essential to have 3 different kinds of exceptions. the function will be explicitly testing for these.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
what type of exception to use? - by Skaperen - Sep-28-2022, 10:56 PM
RE: what type of exception to use? - by bowlofred - Sep-29-2022, 03:55 AM
RE: what type of exception to use? - by Gribouillis - Sep-29-2022, 09:23 AM
RE: what type of exception to use? - by Skaperen - Sep-30-2022, 05:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Exception: Returned Type Mismatch Error devansing 1 5,288 Mar-06-2020, 07:26 PM
Last Post: ndc85430
  Type hinting - return type based on parameter micseydel 2 2,575 Jan-14-2020, 01:20 AM
Last Post: micseydel
  How to fix 'uncaught exception of type NSException' in Python MonsterPython 0 2,235 Jul-09-2019, 06:52 AM
Last Post: MonsterPython
  Stack trace shows different exception type than print micseydel 5 4,551 Apr-01-2019, 10:24 PM
Last Post: micseydel
  During handling of the above exception, another exception occurred Skaperen 7 27,109 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  choice of exception type Skaperen 1 2,412 Sep-01-2018, 05:50 AM
Last Post: Gribouillis

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020