Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
question about descriptor
#6
(Jan-09-2024, 07:00 AM)akbarza Wrote: in the above code, by removing line 18, the code works again.
If you remove line 18, there is no descriptor any more and __get__ or __set__ are not called. Python creates an ordinary attribute age in the dictionary of the Person instance.
« We can solve any problem by introducing an extra level of indirection »
Reply


Messages In This Thread
question about descriptor - by akbarza - Jan-07-2024, 11:54 AM
RE: question about descriptor - by Gribouillis - Jan-07-2024, 02:50 PM
RE: question about descriptor - by akbarza - Jan-08-2024, 07:35 AM
RE: question about descriptor - by Gribouillis - Jan-08-2024, 10:29 PM
RE: question about descriptor - by akbarza - Jan-09-2024, 07:00 AM
RE: question about descriptor - by Gribouillis - Jan-09-2024, 07:09 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Type conversion issue while using Descriptor in Python3 mailnsuresh 1 2,915 May-07-2020, 12:26 PM
Last Post: deanhystad
  strange effect from duplicating a file descriptor Skaperen 1 2,096 Feb-18-2019, 08:20 PM
Last Post: Skaperen

Forum Jump:

User Panel Messages

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