TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Be careful with exec and eval in Python

45 pointsby mattybover 14 years ago

2 comments

IgorPartolaover 14 years ago
Is there any reason why you would want to use exec or eval? In any language? I have never seen the need for it, but have seen plenty of very poor uses of eval in PHP and JavaScript. Are there any legitimate ones, aside from writing a debugger of some kind?
评论 #2166985 未加载
评论 #2166824 未加载
评论 #2167443 未加载
评论 #2166777 未加载
评论 #2167024 未加载
评论 #2167903 未加载
评论 #2167792 未加载
评论 #2167184 未加载
评论 #2167564 未加载
评论 #2168086 未加载
IgorPartolaover 14 years ago
A nugget from an old version of WordPress:<p><pre><code> eval('$v_result = '.$p_options[PCLZIP_CB_PRE_EXTRACT].'(PCLZIP_CB_PRE_EXTRACT, $v_local_header);')</code></pre>