Python's translation of C#'s "ref" keyword? -


in c#, keyword ref can force value types passed reference. so:

class refexample {     static void method(ref int i)     {         = + 44;     }      static void main()     {         int val = 1;         method(ref val);         console.writeline(val);         // output: 45     } } 

question: idiomatic way translate method python?


Comments

Popular posts from this blog

angular - DownloadURL return null in below code -

python 2.7 - Given three nested dictionaries, sort the top two nested dictionaries from a value in the innermost dictionary? -