Created
January 3, 2012 19:44
-
-
Save garybernhardt/1556539 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Python array methods: | |
>>> [m for m in dir([]) if not m.startswith("_")] | |
['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove', 'reverse', | |
'sort'] | |
Ruby array methods: | |
>> ([].methods - Object.methods).sort | |
=> ["&", "*", "+", "-", "<<", "[]", "[]=", "all?", "any?", "assoc", "at", | |
"choice", "clear", "collect", "collect!", "combination", "compact", "compact!", | |
"concat", "count", "cycle", "delete", "delete_at", "delete_if", "detect", | |
"drop", "drop_while", "each", "each_cons", "each_index", "each_slice", | |
"each_with_index", "empty?", "entries", "enum_cons", "enum_slice", | |
"enum_with_index", "fetch", "fill", "find", "find_all", "find_index", "first", | |
"flatten", "flatten!", "grep", "group_by", "index", "indexes", "indices", | |
"inject", "insert", "join", "last", "length", "map", "map!", "max", "max_by", | |
"member?", "min", "min_by", "minmax", "minmax_by", "nitems", "none?", "one?", | |
"pack", "partition", "permutation", "pop", "product", "push", "rassoc", | |
"reduce", "reject", "reject!", "replace", "reverse", "reverse!", | |
"reverse_each", "rindex", "select", "shift", "shuffle", "shuffle!", "size", | |
"slice", "slice!", "sort", "sort!", "sort_by", "take", "take_while", "to_ary", | |
"transpose", "uniq", "uniq!", "unshift", "values_at", "yaml_initialize", "zip", | |
"|"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment