Python: listing variables from object
<p>So basically I need help with laziness.</p>

<p>Is it possible in python to take an object, and then list off all it's variables</p>

<p>For example</p>

<pre><code>class some_object:
  def __init__(self):
    self.Name = None
    self.UUID = None
</code></pre>

<p>then call a magic function that lists all the variable names in the object</p>

<p>and maybe return something that looks close to this:</p>

<pre><code>[some_object.Name, some_object.UUID]
</code></pre>

<p>Keep in mind I DON'T NEED the values attached to the object, but rather the name of the variable, such as Name and UUID</p>

<p>if anyone could help me, that'd be awesome.</p>

<p>Edit:
Thanks for everyone answering my question, the magic function I needed was vars (). I really appreciate everyone effort and input on the problem</p>

<p>You can use vars():</p>

<pre><code>class about_me:
  def __init__(self):
    self.name = "Lyend Victorian"
    self.age = "25"
    self.height = "180"

me = about_me()

&gt;&gt;&gt; vars(me)
{'age': '25', 'name': 'Lyend Victorian', 'height': '180'}
</code></pre>

python