#Writing Python Modules

1 messages · Page 1 of 1 (latest)

coral ledge
#

@frigid warren if you get a chance can you let me know if all that looks right to you? If so, I will work on adding this to our docs.

frigid warren
#

It's already in the docs, and the sdk/python/dev module is an example of this.

#

I'd probably put db under src/main/db, depending on what you plan on putting there. Remember that soon that'll become src/my_module/db.

coral ledge
#

Oh that is great, thanks so much Helder!

The only thing that is confusing to me is still that we have code inside of __init__.py in the docs example, I thought this was an antipattern in python?

So instead of src/main/__init__.py I would expect there to be somethign like src/main/foo.py that contains the actual logic of whats inside of src/main/__init__.py

frigid warren
coral ledge
#

But otherwise this is great, glad its already in the docs!

frigid warren
#

Do you mind making that change?

#

Otherwise I can do it tomorrow.

#

You can also see a bit further that I've added instructions to put a single main.py next to pyproject.toml.

coral ledge
#

Yeah I am happy to do it!