Live data from Hacker News

StackOverflow Importer – Import code from Stack Overflow as Python modules

github.com

31–40 of 87 posts

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#33
post #10

What a fascinating concept! I think that with some kind of review built in, this kind of dynamic loading would be really useful. I think if you do this, you'd want external tests, or some way to pull the code in and "freeze" it so that you wouldn't be at risk of external compromises. (For example, a high ranked SO user might be able to change a highly ranked answer . They might not do it, but someone suborning their…

code is data; lispy!

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#35
post #3

because executing arbitrary unknown code is always a good idea

On the other hand, at least the code has gone through some review.

Compare that to NPM or PyPI, which is full of crap. Some of the modules in PyPI were merely ads for putlocker, without even a single line of Python.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#36

Cool joke. Post leftpad it needs a disclaimer lest someone actually do this for real.

I'm kind of shocked how many people here are talking as though they would actually include this in a codebase.

What if, somehow, there was a guarantee that the code can't harm your machine -- would you use it then?

This isn't a joke.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#37
post #10

What a fascinating concept! I think that with some kind of review built in, this kind of dynamic loading would be really useful. I think if you do this, you'd want external tests, or some way to pull the code in and "freeze" it so that you wouldn't be at risk of external compromises. (For example, a high ranked SO user might be able to change a highly ranked answer . They might not do it, but someone suborning their…

Agreed. It'd be cool if snippets had a checksum api.

Re: StackOverflow Importer – Import code from Stack Overflow as Python modules

#39
This might be a joke but everybody does it manually for real. Whenever I copy-paste some tricky function from SO I like to add a code comment with the url pointing to the stackoverflow.com answer. This allows future maintainers to refer back to SO and see if a better answer has surfaced or read comments about any issues.
Post reply on HN