Posts: 4,654
Threads: 1,497
Joined: Sep 2016
Mar-06-2021, 11:40 PM
(This post was last modified: Mar-06-2021, 11:41 PM by Skaperen.)
documentation for builtin function
issubclass() says it returns
True for the right conditions but otherwise raises
TypeError. when i call it with a wrong condition it just returns
False.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,654
Threads: 1,497
Joined: Sep 2016
(Mar-07-2021, 09:15 AM)Gribouillis Wrote: This could be an opportunity for you to become a Python core developer by sending a pull request.
i don't want to become a Python core developer.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,654
Threads: 1,497
Joined: Sep 2016
maybe, instead, i'll create Cobra, which if an exception is raised, deletes the source file.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,654
Threads: 1,497
Joined: Sep 2016
where does it say the part "when not return True or False"? where does is say
anything about
False?
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Posts: 4,654
Threads: 1,497
Joined: Sep 2016
(Mar-08-2021, 06:28 AM)ndc85430 Wrote: Given that the function returns True
in some cases, it should be obvious that it would return False
in others (and really if a function is called "is something", you'd expect it to return a Boolean. Throwing an exception in the false case seems like bad design to me, as it's confusing for the caller.
it may seem obvious but lots of other things are documented complete enough that you don't need to depend on your imagination. besides this documentation does say what it does in
other cases.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.