zlacker

[parent] [thread] 15 comments
1. hannib+(OP)[view] [source] 2022-09-06 00:18:37
I really like the overall design and ethos, but a new project without typehints, pydoc, and at least some tests just isn't the kind of thing I'd bring into my stack. Hope it gets a little bit of polish!
replies(3): >>notaco+Z >>nerdpo+U1 >>welder+a2
2. notaco+Z[view] [source] 2022-09-06 00:26:34
>>hannib+(OP)
I understand the idea of moving "iteratively" etc, but this is a major thing for me when projects are mentioned as "only took a week to get this all done" yet a lot of commonly accepted best practice is left by the way side.
replies(2): >>welder+m3 >>swyx+L6
3. nerdpo+U1[view] [source] 2022-09-06 00:33:13
>>hannib+(OP)
Seems more like a hobby project than an attempt at a serious production-grade library. But you never know, it might become one some day!
replies(2): >>glauco+uc >>welder+5x
4. welder+a2[view] [source] 2022-09-06 00:35:58
>>hannib+(OP)
It does have some typehints... but I don't like Python types when they require importing the object only for the purpose of types. I only import objects when they're actually used in the non-type code, and I don't like to use `if typing.TYPE_CHECKING`.

These days I use Go when I need types.

replies(1): >>ttymck+4b
◧◩
5. welder+m3[view] [source] [discussion] 2022-09-06 00:46:31
>>notaco+Z
Tests? We don't need no stinking tests! [1] I didn't plan to open source this so quickly, if ever. I'm just happy it's working for WakaTime. The makefile has plans for pytest, but honestly my motivation for tests has waned after fixing the production issues with Celery.

[1] https://en.wikipedia.org/wiki/Stinking_badges

◧◩
6. swyx+L6[view] [source] [discussion] 2022-09-06 01:14:14
>>notaco+Z
well theres a cold start problem here. your bar for adoption is understandable, yet OP is probably also seeking substantive feedback on the solution and the problem space. the top hn comments now provide neither. this discourages future posts by people testing the waters. acceptable individually but on aggregate the community loses out (eg imagine if we judged segment and sentry at launch with these standards).
◧◩
7. ttymck+4b[view] [source] [discussion] 2022-09-06 01:50:29
>>welder+a2
Why is this a problem? When would you reference the type but not actually need the type? If you're returning the type from some method in your API, but not instantiating it there?
replies(1): >>welder+Ww
◧◩
8. glauco+uc[view] [source] [discussion] 2022-09-06 02:00:25
>>nerdpo+U1
Ah yes, "hobby projects" you don't want to go paying those any attention ... https://en.wikipedia.org/wiki/History_of_Linux#The_creation_... ...
◧◩◪
9. welder+Ww[view] [source] [discussion] 2022-09-06 05:03:34
>>ttymck+4b
Yes, if you're accepting the type as a param or returning the type. It happens very frequently, and without moving those imports behind "if typing.TYPE_CHECKING", you constantly run into cyclic imports.

https://stackoverflow.com/questions/39740632/python-type-hin...

replies(1): >>heaven+yk1
◧◩
10. welder+5x[view] [source] [discussion] 2022-09-06 05:05:00
>>nerdpo+U1
It's being used in production at https://wakatime.com and performing better than Celery was, but yes it's an internal project that was open sourced early stage.
replies(1): >>nerdpo+3f1
◧◩◪
11. nerdpo+3f1[view] [source] [discussion] 2022-09-06 11:50:36
>>welder+5x
You are pretty damn brave to build your own distributed task queue and put it into production without tests!
replies(2): >>heaven+Mk1 >>welder+js1
◧◩◪◨
12. heaven+yk1[view] [source] [discussion] 2022-09-06 12:23:55
>>welder+Ww
It happens very frequently if you are not very good at separating your data model from logic.
replies(1): >>welder+qr1
◧◩◪◨
13. heaven+Mk1[view] [source] [discussion] 2022-09-06 12:25:06
>>nerdpo+3f1
They are not brave, they are just fixing all issues manually whenever a customer calls them about it.
◧◩◪◨⬒
14. welder+qr1[view] [source] [discussion] 2022-09-06 13:07:18
>>heaven+yk1
Why would there exist a way in Python to conditionally import types, for the purpose of preventing cyclic imports, if cyclic imports weren't a problem?

Your comment makes it seem like you haven't experienced Python types enough, or you wouldn't think it was so easy.

replies(1): >>heaven+Zkk
◧◩◪◨
15. welder+js1[view] [source] [discussion] 2022-09-06 13:11:26
>>nerdpo+3f1
I built a local test app that does have some integration tests, and then I just went all in on production. That's why I was surprised it worked so well. I was ready to lose a few nights sleep debugging it in prod, but thankfully didn't have to.
◧◩◪◨⬒⬓
16. heaven+Zkk[view] [source] [discussion] 2022-09-12 12:37:01
>>welder+qr1
> Your comment makes it seem like you haven't experienced Python types enough, or you wouldn't think it was so easy.

Oh trust me I did and I constantly slap on the wrists juniors who over-complicate their solutions to the problem :)

> Why would there exist a way in Python to conditionally import types, for the purpose of preventing cyclic imports, if cyclic imports weren't a problem?

Because it's easier to understand than the solution to cyclic imports without conditional imports.

[go to top]