Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about getattr()
#2
Well, think about it: if you didn't have quotes, you'd have

getattr(Person, age)
Of course, Python would look for a variable called age. What else could it do?

The question isn't specific to getattr, though.
Reply


Messages In This Thread
question about getattr() - by ryfoa6 - Apr-07-2020, 06:13 PM
RE: question about getattr() - by ndc85430 - Apr-07-2020, 06:19 PM
RE: question about getattr() - by ryfoa6 - Apr-07-2020, 06:27 PM
RE: question about getattr() - by deanhystad - Apr-07-2020, 07:16 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  About getattr() MingyuanLuo 7 6,047 Mar-20-2019, 01:46 PM
Last Post: ichabod801
  Vars and getattr problem catosp 5 4,285 Aug-28-2018, 02:54 PM
Last Post: buran

Forum Jump:

User Panel Messages

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