make compatible with resources that override getattr (like MongoClient)