Python Forum
how operators are implemented as function calls
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how operators are implemented as function calls
#1
i remember a thread a while back that touched on how various operators were implemented as funtion calls. i'm more curious about this, now, but i cannot find the thread. so i'd like to know what document i can read that describes this. one of the things i'm curious about is how assignments differ from data fetches in, for example, a dictionary. if i do = mydict[x] vs. mydict[x] = how do the function calls differ. is this an implementation decision?

edit:

i'd imagine it could be just one function that with just one argument means to fetch data indexed by that argument, and with two arguments means to store the data (given in the 2nd argument) at the specified index.

edit:

i've noted that a few posts show that some of you know about expressing an assembly-like language that expresses what goes on inside Python (or at least inside CPython). where did you learn this? is there a document that explains all of this?
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
how operators are implemented as function calls - by Skaperen - Dec-14-2018, 04:50 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  optimizing calls to isinstance() Skaperen 0 915 Nov-27-2022, 01:33 AM
Last Post: Skaperen
  omitting arguments in function/method calls Skaperen 10 4,059 Nov-24-2019, 10:13 PM
Last Post: Gribouillis
  overload operators anjita 4 2,584 Jan-04-2019, 12:31 PM
Last Post: buran
  has anyone implemented a sort command in Python? Skaperen 10 5,387 Dec-20-2018, 05:44 AM
Last Post: Skaperen
  Ugh, Someone Went and Implemented Case ichabod801 2 2,774 Sep-15-2017, 09:46 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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