Python Forum
arg and keyword arg conflict: what to raise
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
arg and keyword arg conflict: what to raise
#5
I would raise TypeError in such a case. For example
>>> def f():
...     pass
... 
>>> f(3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f() takes 0 positional arguments but 1 was given
Reply


Messages In This Thread
RE: arg and keyword arg conflict: what to raise - by Gribouillis - Jun-21-2020, 05:56 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  shouldn't this raise an exception? Skaperen 3 2,878 Dec-11-2021, 06:31 PM
Last Post: Skaperen
  annoying conflict: stat Skaperen 2 2,251 Dec-26-2019, 06:04 AM
Last Post: Skaperen
  venv conflict at shell prompt Skaperen 3 2,885 Feb-21-2019, 02:18 AM
Last Post: Larz60+
  import time conflict Skaperen 2 2,880 Oct-15-2017, 07:44 AM
Last Post: wavic

Forum Jump:

User Panel Messages

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