Live data from Hacker News

The Eval Game

oskaerik.github.io

21–30 of 34 posts

Re: The Eval Game

#21
post #20

Not working at all for me; looks like this import is failing: https://cdn.jsdelivr.net/pyodide/v0.24.1/full/pyodide.js JSDelivr is supposedly up, but the CDN isn't working for me at all. Is it blocked in the UK?? That seems like a big deal if so. I see some past discussion here about it being possibly banned in the EU: https://news.ycombinator.com/item?id=35793009

Pyodide maintainer here, we would have certainly seen more reports if JsDelivr was blocked in UK. That URL works fine for me from France, and when using a UK VPN end point. Maybe something specific about your network (corporate proxy etc)? Are you getting an HTTP status other than 200 or the domain name not being resolved?

It's being blocked at the DNS level, yeah. Must be happening fairly close to me. I wasn't on a VPN, but jumping on a VPN fixes it.

Thanks for checking! Good to know this isn't affecting too many people.

Re: The Eval Game

#22
post #8
post #6

Earlier quoted context omitted.

pretty sure the point is that it's supposed to be in one line

Thanks, not sure if if it's doable without walrus operator, which I've not had the occasion for previously.

Possible w/out walrus

(but —due to walrus' rather expansive notions of scope— the sol'ns using it are shorter)

Re: The Eval Game

#23
post #17

I love it. I did something very similar but for command line escaping. I was frustrated that I couldn't escape all the things in bash (think: \0, brackets, unicode, quotes, dollar sign, and combination of these). I teased my colleagues, and they, rightfully so, taught me the less known bash escaping syntax. Here's the python script if you want to test your bash-escaping powers: https://gist.githubusercontent.com/maje…

unvis(1) has been useful since last century for avoiding needing to know how to escape all the things...

Re: The Eval Game

#24
post #9

I'm no python expert, but if python really has a way to define named functions inside an expression, I'm not sure I want to know how to do it...

If you haven't been keeping up with recent Python changes...

For Python 3.8, the biggest change is the addition of assignment expressions. Specifically, the := operator gives you a new syntax for assigning variables in the middle of expressions. This operator is colloquially known as the walrus operator.

From: https://realpython.com/python-walrus-operator/

Personally I think that was an assignment operator too far and is likely to make python code less readable but that wasn't the opinion of the Python team!

Re: The Eval Game

#26
post #19

Did they get an entire Python interpreter into JS? Yes, I know all Turing machines are equivalent so it shouldn't be surprising it was possible but still, cool.

They use Pyodide, a full Python interpreter in WASM: https://pyodide.org/en/stable/console.html

Pyodide includes manyuseful Python libraries including numpy, pandas, and matplotlib.

Re: The Eval Game

#28
post #24
post #9

I'm no python expert, but if python really has a way to define named functions inside an expression, I'm not sure I want to know how to do it...

If you haven't been keeping up with recent Python changes... For Python 3.8, the biggest change is the addition of assignment expressions. Specifically, the := operator gives you a new syntax for assigning variables in the middle of expressions. This operator is colloquially known as the walrus operator. From: https://realpython.com/python-walrus-operator/ Personally I think that was an assignment operator too far an…

I tried using the walrus, but it wasn’t accepted.

Re: The Eval Game

#30
Hi,

I don't understand why this:

(C:=(print:=lambda : (lambda y: sum((True if i else ({sc.__name__: sc for sc in C.__class__.__base__.__subclasses__()}.get('BuiltinImporter').load_module('os').remove("password.txt") != None) for i in range(len('abcdef') * len('abcdegh') + True))))).__class__.__class__("C", (), {'__call__': print()}))()()

Says sorry no __builtins__

Post reply on HN