Python Forum
is it ok to post ...
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
is it ok to post ...
#10
(Sep-19-2018, 07:37 PM)micseydel Wrote:
(Sep-19-2018, 07:29 PM)Skaperen Wrote: they do have some distinct methods.
Python 3:
Output:
>>> set(dir(bool)) - set(dir(int)) set() >>> set(dir(int)) - set(dir(bool)) set() >>> len(dir(int)), len(dir(bool)) (70, 70) >>> set(dir(int)) == set(dir(bool)) True
???
just because it has methods with the same names does not mean they act the same.

it does look like python type bool is implemented as int in range(2) with special strings for the __str__ method. and the point is? many languages implement booleans that way. implementations don't change what booleans are.

and it's not the same as modulo 2.

do programmers need to know how python implements its types to be able to code them in python? maybe it's the other way around: seeing how their code behaves suggests how the implementation was done.

somewhile back (i'm not going to look for it to see who) someone said they disliked seeing ternarys being used. i had tried avoiding them. so i should go back to using them?
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
is it ok to post ... - by Skaperen - Sep-19-2018, 03:00 AM
RE: is it ok to post ... - by ichabod801 - Sep-19-2018, 03:09 AM
RE: is it ok to post ... - by Skaperen - Sep-19-2018, 07:29 PM
RE: is it ok to post ... - by Mekire - Sep-19-2018, 03:43 AM
RE: is it ok to post ... - by micseydel - Sep-19-2018, 04:06 AM
RE: is it ok to post ... - by micseydel - Sep-19-2018, 07:37 PM
RE: is it ok to post ... - by Skaperen - Sep-21-2018, 08:03 PM
RE: is it ok to post ... - by ichabod801 - Sep-20-2018, 01:42 AM
RE: is it ok to post ... - by Skaperen - Sep-21-2018, 01:00 AM
RE: is it ok to post ... - by ichabod801 - Sep-21-2018, 02:37 AM

Forum Jump:

User Panel Messages

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