Python Forum
Simple question concerning python dot notation.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Simple question concerning python dot notation.
#1
Hi, I do understand a fair amount about object oriented programming. But the following convention using dot notation eludes me.

Although the following code snippet is written using pygame I believe that that question that I have concerns python, specifically.

rect = surface1.get_rect()
rect = rect.move("some position here", "another position here" )
It is on the second line that I am confused. rect is declared on the first line. Then rect.move is used on the second line.

It would appear to me, and I am just guessing, that rect is declared as an object in the first line. That would mean, if correct, that "move" used in the second line would be a method declared in the "rect" class. Somewhere.

Am I close?

Thank You
Tom
Reply


Messages In This Thread
Simple question concerning python dot notation. - by miner_tom - Mar-24-2020, 05:14 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Very Beginner question on simple variables Harvy 1 419 Apr-12-2024, 12:03 AM
Last Post: deanhystad
  Forcing matplotlib to NOT use scientific notation when graphing sawtooth500 4 681 Mar-25-2024, 03:00 AM
Last Post: sawtooth500
  ''.join and start:stop:step notation for lists ringgeest11 2 2,599 Jun-24-2023, 06:09 AM
Last Post: ferdnyc
  issue with converting a scientific notation to standard notation thomaswfirth 4 1,666 Jun-06-2023, 06:06 PM
Last Post: rajeshgk
  Simple Question - ' defined as "a". ?' Ryan012 10 2,009 May-27-2023, 06:03 PM
Last Post: Ryan012
  notation MCL169 8 1,866 Apr-14-2023, 12:06 PM
Last Post: MCL169
  Very simple question about filenames and backslashes! garynewport 4 2,261 Jan-17-2023, 05:02 AM
Last Post: deanhystad
  Python Tkinter Simple Multithreading Question AaronCatolico1 5 1,878 Dec-14-2022, 11:35 PM
Last Post: deanhystad
  Issue in writing sql data into csv for decimal value to scientific notation mg24 8 3,513 Dec-06-2022, 11:09 AM
Last Post: mg24
  A simple "If...Else" question from a beginner Serena2022 6 1,961 Jul-11-2022, 05:59 AM
Last Post: Serena2022

Forum Jump:

User Panel Messages

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