Python Forum
Why can't I explicitly call __bool__() on sequence type?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why can't I explicitly call __bool__() on sequence type?
#3
I don't think str has a __bool__ method. I looked around for a while and I can't find it anywhere (as expected). I think bool() may have tests for some standard types (int, str, list, set...) built into the function and __bool__ is meant as a way to override the default assessment.
Reply


Messages In This Thread
RE: Why can't I explicitly call __bool__() on sequence type? - by deanhystad - Aug-10-2021, 08:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how to: explicitly select the grouping columns after groupby sawtooth500 0 198 May-05-2024, 03:01 AM
Last Post: sawtooth500
  Error : "can't multiply sequence by non-int of type 'float' " Ala 3 3,128 Apr-13-2021, 10:33 AM
Last Post: deanhystad
  TypeError: can't multiply sequence by non-int of type 'float' DimosG 3 3,417 Apr-04-2020, 05:16 AM
Last Post: michael1789
  TypeError: can't multiply sequence by non-int of type 'str' emmapaw24 2 2,543 Feb-03-2020, 05:50 PM
Last Post: michael1789
  Type hinting - return type based on parameter micseydel 2 2,532 Jan-14-2020, 01:20 AM
Last Post: micseydel
  Binding not explicitly declared happening karkas 4 2,906 Aug-05-2019, 05:09 PM
Last Post: karkas
  TypeError: can't multiply sequence by non-int of type 'str' rregorr 2 2,488 Jun-28-2019, 04:43 PM
Last Post: Yoriz
  TypeError: can't multiply sequence by non-int of type 'str' pythonnoob1234 4 4,351 May-21-2018, 06:12 PM
Last Post: wavic
  What do you call this type of parameter? league55 2 2,782 Feb-17-2018, 03:55 AM
Last Post: league55
  Cant multiply sequence by non-int type 'str' foxtreat 6 7,125 Apr-24-2017, 05:28 PM
Last Post: foxtreat

Forum Jump:

User Panel Messages

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