I found in builtins python objects a one named property. The docstring for this says:
Typical use is to define a managed attribute x:
But I don't understend what that means
Could someone explain when and for what we must use this?
I found in builtins python objects a one named property. The docstring for this says:
Typical use is to define a managed attribute x:
But I don't understend what that means
Could someone explain when and for what we must use this?
Note that builtins will return standard built-in objects in python3, It provides direct access to all ‘built-in’ identifiers of Python. You can find more information in https://docs.python.org/3/library/builtins.html
>>> import builtins
>>> vars(globals()['__builtins__']) is vars(builtins)
True
What a builtin.property does is that takes your property and returns attributes for different style classes and what that means that it will be classes that come from an object. What a builtin does is that it is made up of many different functions that are built in, which is obvious but the typical use is to give an attribute about x. This below is an example. If you need any other on builtins or other python Functions go to https://help.kite.com/article/63-using-the-copilot That is where I got the Example. If you want to find more detail about the example type in the search builtin.property. Typical use is to define a managed attribute x that means to return the featureless object x
class C(object):
def __init__(self):
self._x = None
def getx(self):
return self._x
def setx(self, value):
self._x = value
def delx(self):
del self._x
x = property(getx, setx, delx, "I'm the 'x' property.")