mercredi 25 juin 2014

Is there something in Python that is similar to Harmony's let keyword?


Vote count:

0




In Harmony, there is a let keyword that allows for declaration of variables that are scoped to the nearest block. For example



function foo() {
if (true){
let a = 100;
}
return a
}


will result in an error since a is only defined inside the if block.


I know I can use del to achieve the same thing, but that that is manual instead of automatic like the let keyword



asked 38 secs ago

XrXrXr

664





Aucun commentaire:

Enregistrer un commentaire