Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Stackful

970 views

Published on

A lightning talk on Stackful, a pure-Python implementation of dynamically scoped variables for Python

https://github.com/erikrose/stackful

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Stackful

  1. 1. stackfulDynamically scoped variables for Python A ridiculous idea by Erik Rose erik@mozilla.com @ErikRose
  2. 2. <hack>
  3. 3. <hack>
  4. 4. In Perl…sub first { local $x = 1; my $y = 1; second();}sub second { print "x=", $x, "n"; # Prints x=1. print "y=", $y, "n"; # Doesnt.}first();http://perl.plover.com/local.html
  5. 5. In Perl…sub first { local $x = 1; my $y = 1; second();}sub second { print "x=", $x, "n"; # Prints x=1. print "y=", $y, "n"; # Doesnt.}first();http://perl.plover.com/local.html
  6. 6. In Python…from stackful import stackfulwith stackful(some_global, 8): foo()
  7. 7. https://github.com/erikrose/stackful erik@mozilla.com @ErikRose

×