3 ms·
I think inline async has its place. I'm hopeful this will speed adoption of PEP 380 which should cleanup the syntax a bit. I'd prefer C# 5's await keyword rat
by equark 16y ago
I think inline async has its place. I'm hopeful this will speed adoption of PEP 380 which should cleanup the syntax a bit. I'd prefer C# 5's await keyword rather than yield from, but that's minor.
That said, I agree that Python needs better function literals. I'd also like a better solution to query syntax than all these variable__gt=5 hacks and strange Q(variable__lt=2) objects that encapsulate what is easily expressed as a python expression. I wish you could pass expression trees, something like db.where("age>5 and alive=True") without the quotes. Not sure about the best syntax...
- wladimir 16y agoI guess they could 'lend' the syntax from SQLAlchemy, it has exactly that. query.filter(User.age>5) and such.
- zzzeek 16y agoIt was originally from SQLObject, a much older ORM. DeJaVu also has its own variant on Python expressions transforming into SQL using lambdas and bytecode inspection. To my knowledge, the foo__gt=2 thing is a Django-specific concept.