Skip to content

Instantly share code, notes, and snippets.

@clarabstract
Created December 15, 2010 01:54
Show Gist options
  • Select an option

  • Save clarabstract/741517 to your computer and use it in GitHub Desktop.

Select an option

Save clarabstract/741517 to your computer and use it in GitHub Desktop.
name = project.contact?.name
# equivalent to:
temp = getattr(project, 'contact', None)
if temp is Null: #or just if not temp... whevs
name = temp
else:
name = temp.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment