Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def process_data(obj):
- # Check if the object has an attribute named 'process'
- # and verify that it is callable.
- if hasattr(obj, 'process') and callable(obj.process):
- return obj.process()
- # Return None if it doesn't exist or isn't callable
- return None
Advertisement
Add Comment
Please, Sign In to add comment