thejsdeveloper

Posts tagged “Python

7 articles

Vikas Yadav

Your prompt is a function signature

I ran the same prompt three times on the same input and got three different shapes back. Nothing crashed. The output just quietly stopped being something my code could trust.

Vikas Yadav

The model never runs your function

I spent months thinking function calling meant the LLM executes my code. It never does. It asks, I run it. Once that clicked, agents stopped being magic and turned into a while loop I could have written.

Vikas Yadav

FastAPI is the Express + Zod + Swagger stack collapsed into the type system

The last post in the series. I rebuilt my Express reflexes in FastAPI, found the type hints doing the validation, the docs, and the serializing, then made it stream.

Vikas Yadav

Python handed me the keys to the event loop and said you start it

async/await transfers almost 1:1 from JS, but Python's event loop is not ambient. Two gotchas from wiring up token-by-token streaming.

Vikas Yadav

Python politely told me to stop writing JavaScript in it

List comprehensions, a reversed join(), and KeyError instead of undefined. Small syntax, but the idioms took real unlearning.

Vikas Yadav

Pydantic: Zod for Python

If you have used Zod, you already understand 70 to 80% of Pydantic. The mental model transfers almost one-to-one.

Vikas Yadav

Python tooling for frontend devs

Coming from npm and node_modules, Python tooling felt alien until I found uv. Here is the 1:1 mapping that made it click.