Python Forum
omitting arguments in function/method calls
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
omitting arguments in function/method calls
#10
the 4 argument case could reject any call with only 1 argument provided as "ambiguous" by raising an exception. the 3 or 4 argument cases could be a case of requesting a verification of the values and whether they fit each other, or not by how much. it could return a value indicating how close.

this function, which i have already implemented in C, takes amps, volts, watts, and ohms. given any 2 it calculates the other 2. i'm thinking of using 0.0 as the value meaning omitted.
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
RE: omitting arguments in function/method calls - by Skaperen - Nov-24-2019, 09:28 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  optimizing calls to isinstance() Skaperen 0 901 Nov-27-2022, 01:33 AM
Last Post: Skaperen
  extracting a function/class/method from code Skaperen 5 2,258 Mar-30-2022, 12:13 AM
Last Post: Skaperen
  function/method keyword argument alias Skaperen 1 3,126 Dec-01-2019, 03:56 AM
Last Post: Gribouillis
  how operators are implemented as function calls Skaperen 5 3,508 Dec-15-2018, 03:14 AM
Last Post: ichabod801

Forum Jump:

User Panel Messages

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