Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6215941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:08:46+00:00 2026-05-24T07:08:46+00:00

I am looking for a pure Python implementation of the property builtin to understand

  • 0

I am looking for a pure Python implementation of the property builtin to understand how initialization works. I have found many that deal with the descriptor interface (__get__, __set__) but none describing the setter or deleter methods. Is this definition in the Python Decorator Library (roughly) the way it is implemented?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T07:08:48+00:00Added an answer on May 24, 2026 at 7:08 am

    Property is a simple, straightforward descriptor. Descriptor protocol consists of three methods: __get__, __set__ and __delete__. Property for each of those operations simply calls user-provided functions.

    class my_property(object):
        def __init__(self, getter, setter, deleter):
            self.getter  = getter
            self.setter  = setter
            self.deleter = deleter
    
        def __get__(self, instance, owner):
            return self.getter(instance)
    
        def __set__(self, instance, value):
            self.setter(instance, value)
    
        def __delete__(self, instance):
            self.deleter(instance)
    
    class Foo(object):
        def __init__(self):
            self._x = 42
    
        def get_x(self):
            print 'getter'
            return self._x
    
        def set_x(self, value):
            print 'setter'
            self._x = value
    
        def del_x(self):
            print 'deleter'
            del self._x
    
        x = my_property(get_x, set_x, del_x)
    
    obj = Foo()
    print obj.x
    obj.x = 69
    del obj.x
    print obj.x
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a Ruby or Python implementation of the Git client that can
I am looking for a pure Javascript/Python upload example, that uses server polling instead
I'm looking for a pure Python module that implements a matrix class where the
I'm looking for an open source, pure Python library that supports the SyncML protocol,
I am looking for a (preferably pure) python library to do AES 256 encryption
I've spent some time today looking for a pure ruby library that will parse
I'm looking for a pure Python font renderer. I don't need it to render
I was looking at the builtin object methods in the Python documentation , and
I have recently been looking at code, specifically component oriented code that uses threads
I'm looking for a pure javascript, open-sourced, wiki implementation, preferably one using NodeJS. Where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.