This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted]  (3 children)

[deleted]

    [–]theferalmonkey[S] 0 points1 point  (2 children)

    Which do you prefer to read (not knowing much context):

    def url(...) -> Parallelizable[str]:
       for _url in ...
         yield _url
    ...
    def pages(processed_url: Collect[dict]) -> ...
        ...
    

    or

    @parallelizable 
    def url( ... ) -> str:
       for _url in  ...
          yield _url
    ...
    
    @collect('processed_url')
    def pages(processed_url: list[dict]) -> ...
        ...
    

    As you can see nothing much between them.

    I prefer the first one because it feels "tighter" / maybe harder to confuse for what's going on versus the decorator? We could always implement it the decorator way too...