Skip to content

Instantly share code, notes, and snippets.

@orlp
Created January 31, 2012 13:05
Show Gist options
  • Select an option

  • Save orlp/1710393 to your computer and use it in GitHub Desktop.

Select an option

Save orlp/1710393 to your computer and use it in GitHub Desktop.
import inspect
def merge_objects(iterable):
class MergedObject: pass
merged = MergedObject()
for obj in iterable:
merged.__dict__.update(inspect.getmembers(obj))
return merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment