Question: I am trying to prevent an instance from throwing an exception if a method that does not exist for the instance is called. I have tried the following:

```
class myClass(object):
    def __init__(self):
        pass
    def __getattr__(self,name):
        print "Warning - method {0} does not exist for this instance".format(name)

o = myClass()
var = o.someNonExistantFunction()

```

The problem is that I get the following error:

```
TypeError: 'NoneType' object is not callable

```

The two things I want to make sure of doing is:

1. Return `None` as my code can deal with variables being set to `None`
2. Perform a function (printing a warning message)

What is the cleanest way to do this?

Answer: 
This is called "Action Bar" you can get it nativly starting from [Android 3.0](http://developer.android.com/guide/topics/ui/actionbar.html) or grab code to do it on earlier versions of android [here.](https://stackoverflow.com/questions/2900509/android-action-bar-like-twitter-sample)
android site has a demo you can check [CustomTitle](http://developer.android.com/resources/samples/ApiDemos/src/com/example/android/apis/app/CustomTitle.html), and [how-to-create-custom-window-title-in-android](http://www.londatiga.net/it/how-to-create-custom-window-title-in-android/)