title: How can I use a class method to create a custom class instance?
body: <p>I'm quite new to Python OOP and trying to create a class I can generate instances of in these two ways according to whether I want to customize the instance or not:</p>
  
  <pre><code>alien_one = Alien(1)
  alien_two = Alien(1).customize(anger=5, emotion=1)
  </code></pre>
  
  <p>I got the following code working after messing around with classmethods and staticmethods, which I feel I should have been using according to other threads:</p>
  
  <pre><code>class Alien(object):
      def __init__(self, polarity):
          self.polarity = {1 : 'friendly', 2 : 'aggressive'}
  
      def customize(self, **kwargs):
          for event in kwargs:
              # // process events to change self.polarity
          return self
  </code></pre>
  
  <p>Is this code appropriate for creating an instance of Alien or should I be using method decorators to generate the instance? There is just something that feels broken about this before I've started.</p>
  
  <p>Edit: Thanks all for the responses, the general consensus is to pass any expressions or kwargs into <code>__init__</code>. Some of the example code I have been referring to looked like this:</p>
  
  <pre><code>query = Tweet.update(is_published=True).where(Tweet.creation_date &lt; today)
  </code></pre>
  
  <p>which is an example taken from the Peewee ORM. When I have tried to use method decorators (static/class) inside my class I have lost the <code>is_published</code> parameter and have no access to it. For understanding more clearly can anybody explain how both <code>is_published</code> and <code>Tweet.creation_date</code> is likely to be received inside the class object, it does seem that query is a brand new instance of the Tweet class. I'm only using Peewee as an example to understand how this code works rather than trying to figure how any details of Peewee works itself.</p>