in reply to Re^6: Nesting Functions
in thread Nesting Functions

yes there's hoisting happening in Python (though hoisting might be a JS term)

OK if you want to define "lexical" by the order of statements inside a scope, (our is a good example) than let's compromise on "private" .

Both Perl and Python have private variables.

OK?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^8: Nesting Functions
by Eily (Monsignor) on Jul 19, 2019 at 14:58 UTC

    My "OK" is on your edit where variables in python are now described as being similar to my, rather than implying that they are equivalent ;-). As a compromise, I can also change my statement into:

    Python doesn't have sane lexicals.

      > on your edit where variables in python are now described as being similar to my

      not sure if I introduced "similar" now, but I certainly wrote "More or less" right from the begining! :-P

      I think it's a bit messy that we use "lexical" for scope and variable in Perl.

      That's why the documentation for our is confusing, it binds a symbol inside a lexical scope to a non-lexical variable.

      > Python doesn't have sane lexicals.

      Everything has a price, code looks tidier but no chance to have strict checking.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice