Marijke Luttekes on Nostr: Python devs, I'd like your opinion on putting extensive business logic in ...
Python devs, I'd like your opinion on putting extensive business logic in `__init__.py`.
It makes me feel a bit icky because it often leads to unavoidable imports. Sometimes, it gets mixed with import shortcut definitions and other administrative stuff.
Personally, I like my inits to be empty, as much as possible.
But maybe that is just me being silly.
So, what do you think of business logic in `__init__.py`?
#Python
Published at
2025-04-22 17:53:56 UTCEvent JSON
{
"id": "9bb67cac21dad776747838a01095f58890d2b0462aaa0715113205e8be894ca8",
"pubkey": "6f5b6fead460beb6b46fec8bf096ea243c01becbdfc3d663aa7d485e7d8e50c5",
"created_at": 1745344436,
"kind": 1,
"tags": [
[
"proxy",
"https://fosstodon.org/@mahryekuh/114382893006103427",
"web"
],
[
"t",
"python"
],
[
"proxy",
"https://fosstodon.org/users/mahryekuh/statuses/114382893006103427",
"activitypub"
],
[
"L",
"pink.momostr"
],
[
"l",
"pink.momostr.activitypub:https://fosstodon.org/users/mahryekuh/statuses/114382893006103427",
"pink.momostr"
],
[
"-"
]
],
"content": "Python devs, I'd like your opinion on putting extensive business logic in `__init__.py`.\n\nIt makes me feel a bit icky because it often leads to unavoidable imports. Sometimes, it gets mixed with import shortcut definitions and other administrative stuff.\n\nPersonally, I like my inits to be empty, as much as possible.\n\nBut maybe that is just me being silly.\n\nSo, what do you think of business logic in `__init__.py`?\n\n#Python",
"sig": "4b4af893219f14ff3c2350a6e7b4b10bbb7d6f306d8c1669655e5f0be8c7d652871c2d19f1a7161c4832e868997f8a75119dba9285ffb13a50a6dde838f07746"
}