Skip to content

Instantly share code, notes, and snippets.

@anglinb
Created June 23, 2014 23:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anglinb/34d256e29a29e7ffd833 to your computer and use it in GitHub Desktop.
Save anglinb/34d256e29a29e7ffd833 to your computer and use it in GitHub Desktop.
Python's equivalent of PHP's StdClass

You can use simple dynamic object instance with this command !

o = type('lamdbaobject', (object,), {})()

Like PHP StdClass, a usefull built-in lamdba object instance. Source

@math2001
Copy link

Don't you just need to do this?

class StdClass:
    pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment