title: How can I create a class method with multiple dots?
body: <p>In python I want to create a (class) method with multiple dots, in order to make tests regarding <code>xmlrpc</code> methods, which can have method names with many dots. When I try just the following: </p>
  
  <pre><code>class Foo(object):
      def method.with.many.dots(self):
          return 42
  </code></pre>
  
  <p>I have an invalid syntax. I also tried to use more sophisticated ideas like</p>
  
  <pre><code>class Foo(object):
      def __getattr__(self, attr):
          print attr
  </code></pre>
  
  <p>which also does not work out-of-the-box for method names with a dot. Any ideas how I can create a simple mock object with which I can do something like</p>
  
  <pre><code>mock.some.test.with.many.dots()
  </code></pre>
  
  <p>in python code in a simple way, without starting a <code>xmlrpc</code> server?</p>