Skip to content

Instantly share code, notes, and snippets.

View ggstuart's full-sized avatar

Graeme Stuart ggstuart

View GitHub Profile
@ggstuart
ggstuart / dispatch.py
Last active August 29, 2015 14:09 — forked from spranesh/dispatch.py
def Analyse(obj):
""" Dynamic Dispatch based on object's class type.
This will call the AnalyseClassName
Example: if obj is of type Let, then call AnalyseLet,
if it is of type IfElse call AnalyseIfElse
"""
# Get obj's class name
class_name = obj.__class__.__name__
# Create the function name as a string