anvilistas / anvil-labs

MIT License
8 stars 3 forks source link

zod: try out pythonic names #121

Closed s-cork closed 1 year ago

s-cork commented 1 year ago

Just drafting this so I can sleep on the idea but let me know what you think @meatballs

I think, at the moment, I prefer this, since it's closer to python's typing names z.typeddict is a bit verbose but hey... I didn't choose it

I've left the TypeScript names in as aliases for convenience

See #120 for context

meatballs commented 1 year ago

It seems better to match the typing names, even if they're not what we might have chosen

s-cork commented 1 year ago

merci do you think remove the aliases? Or just leave them in and not document them (whenever I get round to that)

meatballs commented 1 year ago

The latter, I reckon

s-cork commented 1 year ago

And should it be typeddict or typed_dict. Same question with notrequired vs not_required. Part of me prefers the no underscore version.

meatballs commented 1 year ago

General convention is to convert camel case to snake, so the underscored option.

s-cork commented 1 year ago

But maybe it can be like namedtuple?

meatballs commented 1 year ago

There's plenty of stuff in the standard lib that was written well before pep8 existed and doesn't conform to it.

I don't think that justifies non-conformance today.

s-cork commented 1 year ago

Ok - names changed - ready I think