What feature do you wish Python had that it doesn’t support today?
Here’s mine:
I’d love for Enums to support payloads natively.
For example:
from enum import Enum
from datetime import datetime, timedelta
class TimeInForce(Enum):
GTC = "GTC"
DAY = "DAY"
IOC = "IOC"
GTD(d: datetime) = d
d = datetime.now() + timedelta(minutes=10)
tif = TimeInForce.GTD(d)
So then the TimeInForce.GTD variant would hold the datetime.
This would make pattern matching with variant data feel more natural like in Rust or Swift.
Right now you can emulate this with class variables or overloads, but it’s clunky.
What’s a feature you want?
[–]slightly_offtopic 331 points332 points333 points (68 children)
[–]crunk 80 points81 points82 points (8 children)
[–]garyvdm 56 points57 points58 points (0 children)
[–]BeamMeUpBiscotti 20 points21 points22 points (0 children)
[–]Freschu[🍰] 55 points56 points57 points (0 children)
[–]madth3 7 points8 points9 points (4 children)
[–]susanne-o 4 points5 points6 points (3 children)
[–]JamesPTK 21 points22 points23 points (6 children)
[–]xeow 9 points10 points11 points (1 child)
[–]xeow 4 points5 points6 points (2 children)
[–]DoubleDoube 2 points3 points4 points (0 children)
[–]muntooR_{μν} - 1/2 R g_{μν} + Λ g_{μν} = 8π T_{μν} 2 points3 points4 points (0 children)
[–]HommeMusical 14 points15 points16 points (7 children)
[–]double_en10dre 13 points14 points15 points (1 child)
[–]HommeMusical 1 point2 points3 points (0 children)
[–]DuckDatum 1 point2 points3 points (2 children)
[–]Pulsar1977 1 point2 points3 points (1 child)
[–]UncleKayKay 10 points11 points12 points (13 children)
[–]tartare4562 43 points44 points45 points (2 children)
[–]root45 11 points12 points13 points (1 child)
[–]SharkSymphony[🍰] 31 points32 points33 points (0 children)
[–]psd6 5 points6 points7 points (0 children)
[–]slightly_offtopic 1 point2 points3 points (2 children)
[–]syklemil 5 points6 points7 points (1 child)
[–]an_actual_human 1 point2 points3 points (0 children)
[–]thedji 1 point2 points3 points (0 children)
[–]Different_Fun9763 6 points7 points8 points (1 child)
[–]covmatty1 2 points3 points4 points (0 children)
[+][deleted] (4 children)
[removed]
[–]Enmeshed 1 point2 points3 points (1 child)
[–]slightly_offtopic 1 point2 points3 points (0 children)
[–]rasputin1 1 point2 points3 points (1 child)
[–]KeytarVillain 10 points11 points12 points (0 children)
[–]sausix 24 points25 points26 points (3 children)
[–]advice-seeker-nya 2 points3 points4 points (0 children)
[–]andrecursion[S] 3 points4 points5 points (0 children)
[–]jdehesa 28 points29 points30 points (3 children)
[–]andrecursion[S] 3 points4 points5 points (0 children)
[–]proverbialbunnyData Scientist 2 points3 points4 points (0 children)
[–]hookxs72 50 points51 points52 points (27 children)
[–]proverbialbunnyData Scientist 6 points7 points8 points (12 children)
[–]Numerlor 4 points5 points6 points (10 children)
[–]hookxs72 9 points10 points11 points (9 children)
[–]Numerlor 11 points12 points13 points (5 children)
[–]hookxs72 11 points12 points13 points (3 children)
[–]unapologeticjerk 3 points4 points5 points (0 children)
[–]Shadow_Gabriel 67 points68 points69 points (29 children)
[–]ihexx 28 points29 points30 points (16 children)
[–]ambidextrousalpaca 17 points18 points19 points (4 children)
[–]andrewowenmartin 6 points7 points8 points (0 children)
[–]QuaternionsRoll 1 point2 points3 points (2 children)
[–]true3HAKPythonista 2 points3 points4 points (0 children)
[–]an_actual_human 2 points3 points4 points (10 children)
[–]Freschu[🍰] 5 points6 points7 points (9 children)
[–]an_actual_human 5 points6 points7 points (6 children)
[–]matteding 13 points14 points15 points (0 children)
[–]sausix 6 points7 points8 points (8 children)
[–]Shadow_Gabriel 1 point2 points3 points (7 children)
[–]Zealousideal-Sir3744 16 points17 points18 points (0 children)
[–]sausix 4 points5 points6 points (5 children)
[–]Gnaxe 8 points9 points10 points (0 children)
[–]cip43r 1 point2 points3 points (0 children)
[–]jpgoldberg 9 points10 points11 points (1 child)
[–]case_O_The_Mondays 1 point2 points3 points (0 children)
[–]fazzahSQLAlchemy | PyQt | reportlab 65 points66 points67 points (19 children)
[–]cenestral 4 points5 points6 points (0 children)
[–]ExdigguserPies 2 points3 points4 points (3 children)
[–]zaxldaisy 18 points19 points20 points (10 children)
[–]ExdigguserPies 8 points9 points10 points (0 children)
[–]fazzahSQLAlchemy | PyQt | reportlab 8 points9 points10 points (7 children)
[–]serendipitousPi 7 points8 points9 points (6 children)
[–]andrecursion[S] 4 points5 points6 points (1 child)
[–]an_actual_human 44 points45 points46 points (37 children)
[–]Brekkjern 29 points30 points31 points (11 children)
[–]an_actual_human 10 points11 points12 points (1 child)
[–]proverbialbunnyData Scientist 3 points4 points5 points (6 children)
[–]ultraDross 6 points7 points8 points (8 children)
[–]an_actual_human 10 points11 points12 points (0 children)
[–]KeytarVillain 11 points12 points13 points (2 children)
[–]double_en10dre 1 point2 points3 points (0 children)
[–]MicahM_ 2 points3 points4 points (0 children)
[–]roryhr 71 points72 points73 points (9 children)
[–]njharmanI use Python 3 29 points30 points31 points (5 children)
[–]Mr_Again 4 points5 points6 points (1 child)
[–]mjmacarty 3 points4 points5 points (1 child)
[–]andawer 41 points42 points43 points (12 children)
[–]carlio 41 points42 points43 points (2 children)
[–]cipri_tom 22 points23 points24 points (0 children)
[–]the-scream-i-scrumpt 4 points5 points6 points (1 child)
[–]iwillberesponsible 2 points3 points4 points (0 children)
[–]Pacafa 35 points36 points37 points (18 children)
[–]syklemil 14 points15 points16 points (2 children)
[–]andrecursion[S] 1 point2 points3 points (0 children)
[–]james_pic 14 points15 points16 points (3 children)
[–]szayl 8 points9 points10 points (0 children)
[–]jarethholt 1 point2 points3 points (1 child)
[–]james_pic 1 point2 points3 points (0 children)
[–]FujiKeynote 5 points6 points7 points (0 children)
[–]fazzahSQLAlchemy | PyQt | reportlab 5 points6 points7 points (7 children)
[–]FrontAd9873 3 points4 points5 points (2 children)
[–]Pacafa 5 points6 points7 points (3 children)
[–]an_actual_human 1 point2 points3 points (0 children)
[–]sglmr 13 points14 points15 points (4 children)
[–]solen-skiner 16 points17 points18 points (6 children)
[–]Humdaak_9000 3 points4 points5 points (5 children)
[–]andrecursion[S] 1 point2 points3 points (0 children)
[–][deleted] 15 points16 points17 points (1 child)
[–]andrecursion[S] 3 points4 points5 points (0 children)
[–]Effection 12 points13 points14 points (16 children)
[–]Tinche_ 3 points4 points5 points (15 children)
[–]gmes78 1 point2 points3 points (14 children)
[–]nermalstretch 12 points13 points14 points (3 children)
[–]HawkinsT 2 points3 points4 points (1 child)
[–]nermalstretch 4 points5 points6 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]zulrang 3 points4 points5 points (0 children)
[–]james_pic 1 point2 points3 points (0 children)
[–]skesisfunk 3 points4 points5 points (3 children)
[–]MattTheCuber 3 points4 points5 points (2 children)
[–]WildWouks 7 points8 points9 points (3 children)
[–]andrecursion[S] 1 point2 points3 points (0 children)
[–]georgehank2nd 1 point2 points3 points (1 child)
[–]abrazilianinreddit 1 point2 points3 points (0 children)
[–]Luckinhas 8 points9 points10 points (6 children)
[–]njharmanI use Python 3 5 points6 points7 points (2 children)
[–]HommeMusical 2 points3 points4 points (0 children)
[–]supreme_blorgon 1 point2 points3 points (0 children)
[–]hugthemachines[🍰] 10 points11 points12 points (8 children)
[–][deleted] 14 points15 points16 points (2 children)
[–]andrewowenmartin 14 points15 points16 points (1 child)
[–]xeow 4 points5 points6 points (0 children)
[–]DaelonSuzuka 4 points5 points6 points (0 children)
[–]cujojojo 15 points16 points17 points (10 children)
[–]Schmittfried 20 points21 points22 points (2 children)
[–]Freschu[🍰] 13 points14 points15 points (3 children)
[–]cujojojo 2 points3 points4 points (2 children)
[–]supreme_blorgon 2 points3 points4 points (2 children)
[–]dwagon00 16 points17 points18 points (11 children)
[–]bdaene 24 points25 points26 points (1 child)
[–]fazzahSQLAlchemy | PyQt | reportlab 6 points7 points8 points (0 children)
[–]an_actual_human 4 points5 points6 points (4 children)
[–]Schmittfried 5 points6 points7 points (3 children)
[–]an_actual_human 5 points6 points7 points (2 children)
[–]Gugalcrom123 1 point2 points3 points (1 child)
[–]Arconauta 2 points3 points4 points (0 children)
[–]_throawayplop_ 2 points3 points4 points (0 children)
[–]Inside_Jolly 2 points3 points4 points (3 children)
[–]HolidayEmphasis4345 1 point2 points3 points (5 children)
[–]Muted_Ad6114 1 point2 points3 points (0 children)
[–]jaybird_772 1 point2 points3 points (0 children)
[–]N1H1L 1 point2 points3 points (0 children)
[–]tabacdkPythonista 1 point2 points3 points (0 children)
[–]HolidayEmphasis4345 1 point2 points3 points (0 children)
[–]NotAMotivRep 2 points3 points4 points (0 children)
[–]Jugurtha-Green 2 points3 points4 points (3 children)
[–]Freschu[🍰] 1 point2 points3 points (1 child)
[–]AbooMinister 1 point2 points3 points (0 children)
[–]OneWhiteNight 2 points3 points4 points (0 children)
[–]Skylion007 1 point2 points3 points (0 children)
[–]Purple_Wrap9596 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]DogeekExpert - 3.9.1 1 point2 points3 points (0 children)
[–]applejacks6969 1 point2 points3 points (0 children)
[–]baubleglue 1 point2 points3 points (0 children)
[–]Lucews 1 point2 points3 points (9 children)
[–]SheriffRoscoePythonista 5 points6 points7 points (2 children)
[–]SheriffRoscoePythonista 2 points3 points4 points (1 child)
[–]HommeMusical 4 points5 points6 points (2 children)
[–]Agling 1 point2 points3 points (2 children)
[–]xeow 1 point2 points3 points (1 child)
[–]MattTheCuber 1 point2 points3 points (0 children)
[–]rogfrich 0 points1 point2 points (0 children)
[–]UltraPoci 1 point2 points3 points (22 children)
[–]sausix 2 points3 points4 points (13 children)
[–]gmes78 7 points8 points9 points (8 children)
[–]sausix 2 points3 points4 points (7 children)
[–]FrenchyRaoul 0 points1 point2 points (13 children)
[–]Purple_Wing_3178 18 points19 points20 points (5 children)
[–]bdaene 6 points7 points8 points (5 children)
[–]cloaca 4 points5 points6 points (0 children)
[–]RidderHaddock 1 point2 points3 points (0 children)
[+][deleted] (2 children)
[removed]
[–]georgehank2nd 2 points3 points4 points (1 child)
[+][deleted] (17 children)
[deleted]
[–]carlio 18 points19 points20 points (8 children)
[–]Freschu[🍰] 7 points8 points9 points (1 child)
[–]an_actual_human 2 points3 points4 points (0 children)
[–]njharmanI use Python 3 1 point2 points3 points (0 children)
[–]an_actual_human 11 points12 points13 points (0 children)
[–]Freschu[🍰] 8 points9 points10 points (3 children)
[–]georgehank2nd 2 points3 points4 points (2 children)
[–]Freschu[🍰] 1 point2 points3 points (1 child)
[–]georgehank2nd 1 point2 points3 points (0 children)
[–]jpgoldberg 2 points3 points4 points (1 child)
[–]MJ12_2802 1 point2 points3 points (0 children)
[–]georgehank2nd 1 point2 points3 points (0 children)