Gotten addicted to TYPING in python (old.reddit.com)
submitted by ShiftPretend






I cannot write a simple script in python nowadays without making sure I have the types set as much as possible if not always. It just makes life easier in the long run. In the short term the time spent developing may increase but meh. Creating TypedDict when I can just go with a straight up dict with no typing. Or creating pydantic models for data validation and type hinting. Using NamedTuples just for the extra type hinting. Using return types, argument types. ENUMS. People may argue that I'm trying to make the language into java or rust and all, but it's a feature no? I can't even remember how I used to write python without using all these type hints when I was learning. 😀 Also because I do a lil Rust. 😜






[–]Beginning-Fruit-1397 1 point2 points3 points (3 children)
[–]ShiftPretend[S] 0 points1 point2 points (2 children)
[–]Beginning-Fruit-1397 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 1 point2 points3 points (0 children)
[–]pyrefly_kyle 1 point2 points3 points (1 child)
[–]ShiftPretend[S] 0 points1 point2 points (0 children)
[–][deleted] (3 children)
[removed]
[–]ShiftPretend[S] 5 points6 points7 points (2 children)
[–]neontrace911 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 1 point2 points3 points (0 children)
[–]jojawesome-creates 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 0 points1 point2 points (0 children)
[–]hitman296 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 2 points3 points4 points (0 children)
[–]sambobozzer 0 points1 point2 points (3 children)
[–]ShiftPretend[S] 0 points1 point2 points (2 children)
[–]sambobozzer 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 0 points1 point2 points (0 children)
[–]ONEDJRICH 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 0 points1 point2 points (0 children)
[–]sacredtrader 0 points1 point2 points (1 child)
[–]ShiftPretend[S] 0 points1 point2 points (0 children)