Spyke

Replies

Comment on

Mark Zuckerberg banned news on Facebook and Instagram in Canada. Jeff Ballingall, a conservative operative, saw an opportunity. He runs ''Canada Proud'', a facebook page publishing lies

Reply in thread

Google does pay Canadian news companies to show their content.

Part of the issue is that Facebook and Instagram can show news stories without linking out to them, so users don’t get the opportunity to see the news companies’ ads or to sign up for a subscription.

python

Comment on

[Answered] Typehints for functions that have variable signatures

Reply in thread

This is the real answer, overloads are meant for exactly this purpose.

It’ll be something like this:

from typing import Literal, overload

@overload
def foo() -> Data: …
@overload
def foo(return_more: Literal[True]) -> tuple[Data, Data]: …
def foo(return_more: bool = False) -> Data | tuple[Data, Data]
    ...
    if return_more:
        return data, more_data
   return data

You reached the end