Python Forum
function with 'self' input parameter errors out with and without 'self' called
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
function with 'self' input parameter errors out with and without 'self' called
#11
I think Yoriz's solution is good if your method uses event when an event argument is provided. I don't like so much as a way to make your function callable with zero or one arguments. I don't like the idea of twisting the function arguments to fit the vagaries of who may be calling it. If you wanted to make everyone happy you could do this:
def updateMainTasks(*_):
This allows for zero or more position arguments, all of which are unused. Such code is best avoided unless you really need it.
Reply


Messages In This Thread
RE: function with 'self' input parameter errors out with and without 'self' called - by deanhystad - Jan-15-2022, 04:21 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  difference between forms of input a list to function akbarza 6 1,218 Feb-21-2024, 08:02 PM
Last Post: bterwijn
  Multiple variable inputs when only one is called for ChrisDall 2 552 Oct-20-2023, 07:43 PM
Last Post: deanhystad
  determine parameter type in definition function akbarza 1 663 Aug-24-2023, 01:46 PM
Last Post: deanhystad
  Function parameter not writing to variable Karp 5 1,068 Aug-07-2023, 05:58 PM
Last Post: Karp
  Couldn't install a go-game called dlgo Nomamesse 14 3,335 Jan-05-2023, 06:38 PM
Last Post: Nomamesse
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 11,603 Dec-26-2022, 08:48 AM
Last Post: ibreeden
Information How to take url in telegram bot user input and put it as an argument in a function? askfriends 0 1,208 Dec-25-2022, 03:00 PM
Last Post: askfriends
  how can a function find the name by which it is called? Skaperen 18 3,654 Aug-24-2022, 04:52 PM
Last Post: Skaperen
  Showing an empty chart, then input data via function kgall89 0 1,029 Jun-02-2022, 01:53 AM
Last Post: kgall89
  input function question barryjo 12 2,946 Jan-18-2022, 12:11 AM
Last Post: barryjo

Forum Jump:

User Panel Messages

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