Python Forum
which exception should be thrown for a sequence of the wrong length?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
which exception should be thrown for a sequence of the wrong length?
#2
ValueError, because there is an error with the value, wrong length, not the type.

You can make your own exception classes.
Gribouillis likes this post
Reply


Messages In This Thread
RE: which exception should be thrown for ... - by deanhystad - Jan-06-2023, 04:13 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Am I wrong or is Udemy wrong? String Slicing! Mavoz 3 2,718 Nov-05-2022, 11:33 AM
Last Post: Mavoz
  Pytest API Post call thrown errors pyseeker 4 3,732 Dec-08-2019, 04:53 PM
Last Post: pyseeker
  python gives wrong string length and wrong character thienson30 2 3,072 Oct-15-2019, 08:54 PM
Last Post: Gribouillis
  Invalid argument error thrown. pyseeker 4 8,694 Sep-10-2019, 07:03 PM
Last Post: pyseeker
  ValueError: dictionary update sequence element #0 has length 1; 2 Jmekubo 4 35,865 Apr-28-2019, 07:25 PM
Last Post: Jmekubo
  During handling of the above exception, another exception occurred Skaperen 7 27,038 Dec-21-2018, 10:58 AM
Last Post: Gribouillis
  pytest fixture in conftest.py thrown error while in the test file runs OzzieOzzum 1 4,028 Jul-31-2018, 12:12 PM
Last Post: OzzieOzzum
  [split] Teacher (thrown in at the deep end - help) Mr90 2 3,055 May-23-2018, 02:04 PM
Last Post: DeaD_EyE
  Teacher (thrown in at the deep end - help) Mr90 5 3,982 May-22-2018, 01:08 PM
Last Post: DeaD_EyE
  Exception not thrown in python3 ONEoo7 7 6,206 Apr-09-2017, 01:58 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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