python Programming Glossary: dangerous
Safety of Python 'eval' For List Deserialization http://stackoverflow.com/questions/1112665/safety-of-python-eval-for-list-deserialization to god str instance from the Python builtins. If this is dangerous can we do anything to the input to make it safe We definitely.. engine eval share improve this question It is indeed dangerous and the safest alternative is ast.literal_eval see the ast module..
Python - how does passing values work? http://stackoverflow.com/questions/11585768/python-how-does-passing-values-work like mucking around with globals and so on but these are dangerous territory anyway. In particular name value is different from..
How dangerous is setting self.__class__ to something else? http://stackoverflow.com/questions/13280680/how-dangerous-is-setting-self-class-to-something-else dangerous is setting self.__class__ to something else Say I have a class.. invoke the subclass's version of those methods. So how dangerous is doing this It seems weird but is it wrong to do such a thing.. Here's a list of things I can think of that make this dangerous in rough order from worst to least bad It's likely to be confusing..
Difference between __str__ and __repr__ in Python http://stackoverflow.com/questions/1436703/difference-between-str-and-repr-in-python s r self.__class__ self.__dict__ would have been too dangerous for example too easy to get into infinite recursion if objects..
Does python support multiprocessor/multicore programming? http://stackoverflow.com/questions/203912/does-python-support-multiprocessor-multicore-programming those runtimes. In my personal opinion multithreading is dangerous and tricky and it is generally a good thing that Python encourages..
The Python yield keyword explained http://stackoverflow.com/questions/231767/the-python-yield-keyword-explained way to go through all these nested data even if it's a bit dangerous since you can end up with an infinite loop. In this case candidates.extend..
floating point equality in Python and in general http://stackoverflow.com/questions/3049101/floating-point-equality-in-python-and-in-general units. Rhetorical Questions If this is a potentially dangerous problem since it makes programs behave in an undetermanistic..
Maximum recursion depth? http://stackoverflow.com/questions/3323001/maximum-recursion-depth recursion limit with sys.setrecursionlimit but doing so is dangerous the standard limit is a little conservative but Python stackframes..
Using global variables in a function other than the one that created them http://stackoverflow.com/questions/423379/using-global-variables-in-a-function-other-than-the-one-that-created-them the reason for it is that since global variables are so dangerous Python wants to make sure that you really know that's what you're..
How to set sys.stdout encoding in Python 3? http://stackoverflow.com/questions/4374455/how-to-set-sys-stdout-encoding-in-python-3 Eek Is that a well known idiom in Python 2 It looks like a dangerous mistake to me. It'll certainly mess up any script that tries..
Pipe subprocess standard output to a variable http://stackoverflow.com/questions/4514751/pipe-subprocess-standard-output-to-a-variable but this fires up a fully blown shell which can be dangerous if you don't control the contents of the command string. proc..
How do you escape strings for SQLite table/column names in Python? http://stackoverflow.com/questions/6514274/how-do-you-escape-strings-for-sqlite-table-column-names-in-python the queries every time would be far more error prone and dangerous. It comes down to what safe means. The conventional wisdom is..
How to handle “duck typing” in Python? http://stackoverflow.com/questions/6589967/how-to-handle-duck-typing-in-python this will raise some AttributeErrors . I could wrap each dangerous call in a try except block. This too seems kind of cumbersome..
Security of Python's eval() on untrusted strings? http://stackoverflow.com/questions/661084/security-of-pythons-eval-on-untrusted-strings with a blacklist approach like this. See Eval really is dangerous for examples of input that will segfault the CPython interpreter..
How do I execute a string containing Python code in Python? http://stackoverflow.com/questions/701802/how-do-i-execute-a-string-containing-python-code-in-python be the position of last resort It's slow ugly and dangerous if it can contain user entered code. You should always look..
Is it ever useful to use Python's input over raw_input? http://stackoverflow.com/questions/7709022/is-it-ever-useful-to-use-pythons-input-over-raw-input you're doing say eval raw_input . The eval screams I'm dangerous to the trained eye. But odds are you won't ever need this. input..
Letting users upload Python scripts for execution http://stackoverflow.com/questions/818402/letting-users-upload-python-scripts-for-execution anonymous user upload any sort of file in general can be dangerous especially if it's code. However I have an idea to let users..
|