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

  • Home
  • SEARCH
  • 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 952579
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T23:55:01+00:00 2026-05-15T23:55:01+00:00

Assuming you know about Python builtin property: http://docs.python.org/library/functions.html#property I want to re-set a object

  • 0

Assuming you know about Python builtin property: http://docs.python.org/library/functions.html#property

I want to re-set a object property in this way but, I need to do it inside a method to be able to pass to it some arguments, currently all the web examples of property() are defining the property outside the methods, and trying the obvious…

def alpha(self, beta):
  self.x = property(beta)

…seems not to work, I’m glad if you can show me my concept error or other alternative solutions without subclassing the code (actually my code is already over-subclassed) or using decorators (this is the solution I’ll use if there is no other).

Thanks.

  • 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-15T23:55:01+00:00Added an answer on May 15, 2026 at 11:55 pm

    Properties work using the descriptor protocol, which only works on attributes of a class object. The property object has to be stored in a class attribute. You can’t “override” it on a per-instance basis.

    You can, of course, provide a property on the class that gets an instance attribute or falls back to some default:

    class C(object):
        _default_x = 5
        _x = None
        @property
        def x(self):
            return self._x or self._default_x
        def alpha(self, beta):
            self._x = beta
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

assuming that I know the PID of a process and want to do a
assuming that I know nothing about everything and that I'm starting in programming TODAY
Scenario: I know nothing about packages except that they contain functions and procedures all
Assuming that I know there is a git-daemon running at git://git.mycompany.com , how can
Is there a way to know if TAdoQuery in Edit state was changed? Assuming
H​i. I would like to know the address of my user's Exchange server (assuming
Assuming I have a numerical string: var foo = 0; Assume I want to
Assuming all my Gradle plugin user going to have a MYAPP_HOME sys variable set
What I wants for HTML Output <select name=model binding name> <option value=44 data-object=jsonencoded object>122
I've been reading Ulrich Drepper's, What every programmer should know about memory and in

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.