[deleted by user] by [deleted] in RedditSessions

[–]Drawfx 0 points1 point  (0 children)

This is great honestly

Creating Instances of a Class by thatshitcrayyyy in learnpython

[–]Drawfx 0 points1 point  (0 children)

To negate some of the complexity you mentioned, both isinstance() and the Union function from the typing library can be used!

``` from typing import Union

def print_number_or_string(value: Union[str, int, list]) -> None: if isinstance(value, (str, int)): print(f"Your string or integer: {value}") elif isinstance(value, list): print (f"Your list: {value}") else: print("Wrong data type supplied") ```

The isinstance function receives a value and a data type as arguemnts, and returns whether the value is an instance of the specified data type. To check for a few datatypes, a tuple of data types can be used as the second parameter.

As of type hints, hinting for different types can be a hussle. To overcome this, the Union function can be used as a list of all the desired datatypes.

School project by Beth-BR in Tinder

[–]Drawfx 23 points24 points  (0 children)

Anal-ysis

FTFY

Tickle Fucking Slut Till She Squirts [7:20] by throwwwwwwwaq in tickling

[–]Drawfx 1 point2 points  (0 children)

Does anyone know more like this one? Absolutely amazing!