def get_line_no(self, obj):
"""Gets the source line number of this object. None if `obj` code cannot be found.
"""
try:
lineno = getsourcelines(obj)[1]
except:
# no code found
lineno = None
return lineno