title: How to tell if a Python class member is decorated with `@property`
body: <p>I'm subclassing <code>UUID</code> and I was trying to figure out if <code>UUID.hex</code> is a regular member or a method decorated with <code>@property</code>. I had to look at the source code to figure it out, which left me wondering if there was another way.</p>
  <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; import uuid
  &gt;&gt;&gt; x = uuid.UUID('0000180000001000800000805f9b34fb')
  &gt;&gt;&gt; print([attr for attr in dir(x) if callable(getattr(x, attr))])
  ['__class__', '__delattr__', '__dir__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getstate__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__int__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__setstate__', '__sizeof__', '__str__', '__subclasshook__']
  &gt;&gt;&gt; print([attr for attr in dir(x) if not callable(getattr(x, attr))])
  ['__doc__', '__module__', '__slots__', '__weakref__', 'bytes', 'bytes_le', 'clock_seq', 'clock_seq_hi_variant', 'clock_seq_low', 'fields', 'hex', 'int', 'is_safe', 'node', 'time', 'time_hi_version', 'time_low', 'time_mid', 'urn', 'variant', 'version']
  </code></pre>
  <p><a href="https://github.com/python/cpython/blob/46b16d0bdbb1722daed10389e27226a2370f1635/Lib/uuid.py#L334" rel="nofollow noreferrer">The source code</a> is:</p>
  <pre class="lang-py prettyprint-override"><code>    @property
      def hex(self):
          return '%032x' % self.int
  </code></pre>
  <p>It's a method decorated with <code>@property</code>. I was kinda expecting that <code>hex</code> would show up as <code>callable()</code>, but that's not the case. Is there any way I could tell that by examining the class or an object?</p>
  <p>Thanks!</p>