title: Problems with the new style celery api
body: <p>I have a class that extends celerys <code>Task</code>. It runs just fine with the old style API, but I am having problems converting it to the new API.</p>
  
  <pre><code># In app/tasks.py
  from celery import Celery, Task
  
  celery = Celery()
  
  @celery.task
  class CustomTask(Task):
  
      def run(self, x):
          try:
              # do something
          except Exception, e:
              self.retry(args=[x], exc=e)
  </code></pre>
  
  <p>And then I run the task like so -</p>
  
  <pre><code>CustomTask().apply_async(args=[x], queue='q1')
  </code></pre>
  
  <p>And I get the error -</p>
  
  <pre><code>TypeError: run() takes exactly 2 arguments (1 given)
  </code></pre>
  
  <p><a href="https://stackoverflow.com/a/16218702/805427">This SO answer</a> seems to do the same thing and it was accepted so presumably it works. Can anyone help me out and explain to me why my code isn't working?</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>This works if I name the task, different from the class name -</p>
  
  <pre><code>name = 'app.tasks.CustomTask2'
  </code></pre>
  
  <p>But if I keep the name of the task the same as the full class name, it doesn't work</p>
  
  <pre><code>name = 'app.tasks.CustomTask'
  </code></pre>
  
  <p>But the problem with having a different name is that celery has an extra task, with the same name as the task class name.</p>