mastodon.world is one of the many independent Mastodon servers you can use to participate in the fediverse.
Generic Mastodon server for anyone to use.

Server stats:

8.5K
active users

#variadic

0 posts0 participants0 posts today
Hacker News<p>Variadic Switch</p><p><a href="https://pydong.org/posts/variadic-switch/" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">pydong.org/posts/variadic-swit</span><span class="invisible">ch/</span></a></p><p><a href="https://mastodon.social/tags/HackerNews" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>HackerNews</span></a> <a href="https://mastodon.social/tags/Variadic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Variadic</span></a> <a href="https://mastodon.social/tags/Switch" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Switch</span></a> <a href="https://mastodon.social/tags/Variadic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Variadic</span></a> <a href="https://mastodon.social/tags/Functions" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Functions</span></a> <a href="https://mastodon.social/tags/Programming" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Programming</span></a> <a href="https://mastodon.social/tags/Languages" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Languages</span></a> <a href="https://mastodon.social/tags/Software" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Software</span></a> <a href="https://mastodon.social/tags/Development" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Development</span></a> <a href="https://mastodon.social/tags/Hacker" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Hacker</span></a> <a href="https://mastodon.social/tags/News" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>News</span></a></p>
C.<p><span class="h-card"><a href="https://hachyderm.io/@smurthys" class="u-url mention" rel="nofollow noopener" target="_blank">@<span>smurthys</span></a></span> You say return types don't matter, so what are you really looking for here? Just how to handle the function parameters (and their type hints)? Is the variable number of arguments tripping you up?</p><p>So depending on your actual use case....</p><p>def f(a: int | str | float, b: str | float | None = None) -&gt; int | str:<br> ...</p><p>If they pass one argument, or they pass None as the 2nd argument, b will be None. If you need to distinguish those cases, use a sentinel.</p><p><a href="https://mindly.social/tags/python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>python</span></a> <a href="https://mindly.social/tags/variadic" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>variadic</span></a> <a href="https://mindly.social/tags/TypeHint" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>TypeHint</span></a></p>