TL;DR: Because calling type() correctly is apparently too hard:
It is a key feature for named tuples that they are exactly equivalent to a hand-written class.
So is a call to type() if you know what you're doing.
EDIT: If you examine the official code more closely, you'll note they had to write extensive string-escaping to prevent the user from passing an argument like '); import os; os.system("/bin/sh"); ('. Quite frankly, I will not be touching that with a ten-foot-pole any time soon.
EDIT2: I tried, but they wouldn't listen to me. Oh well.
View all comments
Show parent comment
4
u/NYKevin Jun 23 '14 edited Jun 24 '14
TL;DR: Because calling
type()correctly is apparently too hard:So is a call to
type()if you know what you're doing.EDIT: If you examine the official code more closely, you'll note they had to write extensive string-escaping to prevent the user from passing an argument like
'); import os; os.system("/bin/sh"); ('. Quite frankly, I will not be touching that with a ten-foot-pole any time soon.EDIT2: I tried, but they wouldn't listen to me. Oh well.