treyhunner,
@treyhunner@mastodon.social avatar

@iris Great ones!

Here's an even shorter equivalent to locals():

vars()

Relatedly: dir() (for just the names)

Also vars(an_object) or dir(an_object).

Since vars(an_object) only looks at dict they're a bit different. Sometimes I'll do vars(an_object).keys() to see just the attributes that live directly on an object.

  • All
  • Subscribed
  • Moderated
  • Favorites
  • python
  • mdbf
  • DreamBathrooms
  • thenastyranch
  • ngwrru68w68
  • tacticalgear
  • magazineikmin
  • Youngstown
  • khanakhh
  • rosin
  • slotface
  • InstantRegret
  • everett
  • kavyap
  • cubers
  • megavids
  • GTA5RPClips
  • cisconetworking
  • modclub
  • ethstaker
  • osvaldo12
  • Durango
  • normalnudes
  • tester
  • provamag3
  • Leos
  • anitta
  • JUstTest
  • lostlight
  • All magazines