3 ms·
I know Travis and yes he knows those things. What he means by "being dangerous" are things like os.remove(), os.removedirs(), os.chmod(), etc. He wasn't talkin
by frankwiles 15y ago
I know Travis and yes he knows those things.
What he means by "being dangerous" are things like os.remove(), os.removedirs(), os.chmod(), etc. He wasn't talking about crashing your own Python code, but being able to do dangerous things to the OS you're running it on.
- Ixiaus 15y agoWhy is that anymore dangerous than knowing how rm, rmdir, and chmod work on the commandline? Python's os module is not exempt from permissions - it's obviously "dangerous" if you run the interpeter as root then start doing silly things like passing GET parameters to os.remove() directly... But that, IMHO, is no longer dangerous - that's just stupidity. Really, there's nothing remotely dangerous about Python - in terms of using import os (excluding the above example which I consider idiocy), it's no more dangerous than elevating to root!? [EDIT] I would argue that not knowing how something works is more dangerous, but that typically falls under the banner of ignorance.
- jerf 15y ago"Why is that anymore dangerous than knowing how rm, rmdir, and chmod work on the commandline?" To screw up is human. To screw up a million times per second takes a computer. In absolute terms, the two are equivalent. But the capacity for your Python program using os.whatever to unpleasantly surprise you is much greater.
- trafficlight 15y agoThere's nothing like that sinking feeling you get when you do a DELETE FROM and forget the WHERE.
- weaksauce 15y agoThat's exactly why begin transaction is awesome.
- pbhjpbhj 15y agoNone of that is _dangerous_ though because you've got a backup of all your data and your code is all versioned ... unless you're practicing your python on life-support systems or something?