Python Forum
About integer objects vs integer values
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
About integer objects vs integer values
#14
Nwb Wrote:Python doesn't just interpret line by line?
No, python compiles code into a intermediary bytecode language. When this bytecode is loaded in memory, python creates "code object" instances, which are python objects. For every function that you define, there will be a code object. This code object contains the bytecode and various data such as the literal constants that are defined in the code. If there are literal integers 5000 in the function's body, python will create an integer instance stored in the code object and reuse the same instance no matter how many times you call the function.
Reply


Messages In This Thread
About integer objects vs integer values - by Nwb - Apr-25-2019, 04:55 AM
RE: About integer objects vs integer values - by Gribouillis - Apr-28-2019, 01:56 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Does the integer implementation matter? ichabod801 2 1,864 Oct-22-2019, 03:26 PM
Last Post: snippsat
  integer bases Skaperen 7 4,795 Nov-24-2017, 09:46 AM
Last Post: heiner55
  multiplying integer to decimal ArnabRoyBatman 8 12,778 Jun-20-2017, 04:49 PM
Last Post: DeaD_EyE

Forum Jump:

User Panel Messages

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