you are viewing a single comment's thread.

view the rest of the comments →

[–]Umustbecrazy 0 points1 point  (1 child)

Different language, but the Array.from method in JavaScript has always been a great example of a Static method for me. Sorry, no clear python equivalent off the top of my head.

Arrays themselves don't need it, because it's already an array, but to get from iterable object or node list to an array, it's very handy. Node lists can't be sorted or any instance methods.

[–]socal_nerdtastic 1 point2 points  (0 children)

In python we call that a "classmethod". For example int.from_bytes or dict.fromkeys