I'm sure there are already a bunch of good tutorials on how to use properties and decorators, but I rarely used this before, so I'm also sharing this to just wrap my head around it once more.
I am in the middle of writing Py-Mel'ish libraries for motionbuilder and propertys are making my life a lot easier. They will essentially help you reducing your production code later almost by half and make it much more readable.


To get the startframe of the animationrange in motionbuilder you have to do something like this:
FBPlayerControl().ZoomWindowStart.GetFrame()
There is no need to argue that this is just horrible...
Ok, how about setting it? No, its not this
FBPlayerControl().ZoomWindowStart.SetFrame()

Lets try to unify that! There might be similar things we want to do, like get and set the current frame. So let's decide on writing a small timeline class and add a few functions to that.
The functions we will write here, are getter and setter functions. To make a function a getter, you basically add a property-decorator in front of your function.

The setter function is defined like this getter-functionname.setter.
Make sure that this following function has the same name as the getter function.

Take a look at the code example here:

class Timeline(object):
 '''
 This class has functions regarding the timeline such as setting the animationrange or getting the current frame
 '''
 @property
 def animationrange(self): 
  fStart = int(FBPlayerControl().ZoomWindowStart.GetFrame())
  fStop = int(FBPlayerControl().ZoomWindowStop.GetFrame())
  return (fStart,fStop)

 @animationrange.setter
 def animationrange(self,value):
  lSetTimeSpan = FBTimeSpan(FBTime(0,0,0,value[0]),FBTime(0,0,0,value[1])) 
  FBSystem().CurrentTake.LocalTimeSpan = lSetTimeSpan

 @property
 def currentframe(self):
  '''
  Get current frame
  '''
  return FBSystem().LocalTime.GetFrame()

 @currentframe.setter
 def currentframe(self, frame, forceEvaluate=True):
  '''
  Sets the current frame
  '''
  FBPlayerControl().Goto(FBTime(0,0,0,int(frame)))
  if forceEvaluate:
   FBSystem().Scene.Evaluate() 

 Now we just have to instanciate the class
myTimeline = Timeline()
To get the animationrange we just have to do this now
print myTimeline.animationrange
And we set it like this
myTimeline.animationrange = (10,20)
The same goes for the currentframe, to get it we call
print myTimeline.currentframe
And to set it
myTimeline.currentframe = 5


So to recap, properties give you the ability to execute different functions depending on wether you set or get them.