Skip to content

Comment on FuckIt.py - The Python Error Steamrollerparent

Comments

If anyone's interested, the likelihood of a string with a length between 100 and 1000 characters which contains characters randomly selected from digits, lowercase letters, spaces and the following characters: \n,[](){}'."=+-*/%: is valid python is something like 0.015% (determined empirically)

That seems like quite a lot for 100 characters. I'm guessing they are mostly numbers?

EDIT: wait, you actually ran code produced from this?

I just ran the part that generates a function with a random string as the body and called the function that it generated, and counted the calls that didn't throw anything. As I threw it together in all of 5 minutes I'm sure there are flaws in the methodology

Also the defuckify code I posted is not exactly right, as it was sort of a joke but it's pretty easy to fix

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.