I haven't been keeping up with this blog, but I have been keeping busy. A few things I've learned recently:
typeofcommand, it doesn't produce very useful output. In particular, it yields
objectno matter whether the structure in question is a Map, an Array, a Set, or an Object. Apparently,
x.constructoris how to find out what type something actually is.
whichis a program, not a builtin. So it's not aware of aliases, like
python='python3'. Neither is
sudo. So you can check
python --version >= 3but that's no guarantee that
sudo pip installor
sudo python -m pip installwill be python3. It makes me rethink the utility of aliases, and possibly virtualenvs.
Python lists are not implemented with pointers like Lisp lists! Per Peter Norvig, Python list access is O(1); per the Python Design and History FAQ, they are contiguous memory chunks with a head pointer and length value stored up front.
Three things make a post, plus it's dinnertime: fried tofu w/ bbq sauce, risotto, and Sichuan dry-fried mushrooms & peppers.