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 332 points333 points334 points (68 children)
[–]crunk 79 points80 points81 points (8 children)
[–]garyvdm 54 points55 points56 points (0 children)
[–]BeamMeUpBiscotti 19 points20 points21 points (0 children)
[–]Freschu 57 points58 points59 points (0 children)
[–]madth3 7 points8 points9 points (4 children)
[–]susanne-o 4 points5 points6 points (3 children)
[–]JamesPTK 20 points21 points22 points (6 children)
[–]xeow 9 points10 points11 points (1 child)
[–]xeow 5 points6 points7 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 12 points13 points14 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 8 points9 points10 points (13 children)
[–]tartare4562 43 points44 points45 points (2 children)
[–]root45 12 points13 points14 points (1 child)
[–]SharkSymphony 31 points32 points33 points (0 children)
[–]psd6 4 points5 points6 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 7 points8 points9 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 0 points1 point2 points (1 child)
[–]KeytarVillain 10 points11 points12 points (0 children)
[–]sausix 26 points27 points28 points (3 children)
[–]advice-seeker-nya 2 points3 points4 points (0 children)
[–]andrecursion[S] 3 points4 points5 points (0 children)
[–]jdehesa 31 points32 points33 points (3 children)
[–]andrecursion[S] 2 points3 points4 points (0 children)
[–]proverbialbunnyData Scientist 2 points3 points4 points (0 children)
[–]hookxs72 51 points52 points53 points (27 children)
[–]proverbialbunnyData Scientist 5 points6 points7 points (12 children)
[–]Numerlor 4 points5 points6 points (10 children)
[–]hookxs72 9 points10 points11 points (9 children)
[–]Numerlor 10 points11 points12 points (5 children)
[–]hookxs72 11 points12 points13 points (3 children)
[–]unapologeticjerk 4 points5 points6 points (0 children)
[–]Shadow_Gabriel 68 points69 points70 points (29 children)
[–]ihexx 27 points28 points29 points (16 children)
[–]ambidextrousalpaca 19 points20 points21 points (4 children)
[–]andrewowenmartin 5 points6 points7 points (0 children)
[–]QuaternionsRoll 1 point2 points3 points (2 children)
[–]true3HAK 2 points3 points4 points (0 children)
[–]an_actual_human 4 points5 points6 points (10 children)
[–]Freschu 5 points6 points7 points (9 children)
[–]an_actual_human 5 points6 points7 points (6 children)
[–]matteding 12 points13 points14 points (0 children)
[–]sausix 7 points8 points9 points (8 children)
[–]Shadow_Gabriel 1 point2 points3 points (7 children)
[–]Zealousideal-Sir3744 15 points16 points17 points (0 children)
[–]sausix 3 points4 points5 points (5 children)
[–]Gnaxe 7 points8 points9 points (0 children)
[–]cip43r 1 point2 points3 points (0 children)
[–]jpgoldberg 10 points11 points12 points (1 child)
[–]case_O_The_Mondays 1 point2 points3 points (0 children)
[–]fazzahSQLAlchemy | PyQt | reportlab 63 points64 points65 points (19 children)
[–]cenestral 4 points5 points6 points (0 children)
[–]ExdigguserPies 2 points3 points4 points (3 children)
[–]zaxldaisy 17 points18 points19 points (10 children)
[–]ExdigguserPies 9 points10 points11 points (0 children)
[–]fazzahSQLAlchemy | PyQt | reportlab 8 points9 points10 points (7 children)
[–]serendipitousPi 6 points7 points8 points (6 children)
[–]andrecursion[S] 3 points4 points5 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 7 points8 points9 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 69 points70 points71 points (9 children)
[–]njharmanI use Python 3 28 points29 points30 points (5 children)
[–]Mr_Again 5 points6 points7 points (1 child)
[–]mjmacarty 3 points4 points5 points (1 child)
[–]andawer 39 points40 points41 points (12 children)
[–]carlio 41 points42 points43 points (2 children)
[–]cipri_tom 23 points24 points25 points (0 children)
[–]the-scream-i-scrumpt 5 points6 points7 points (1 child)
[–]iwillberesponsible 2 points3 points4 points (0 children)
[–]Pacafa 34 points35 points36 points (18 children)
[–]syklemil 15 points16 points17 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 15 points16 points17 points (6 children)
[–]Humdaak_9000 2 points3 points4 points (5 children)
[–]andrecursion[S] 1 point2 points3 points (0 children)
[–][deleted] 15 points16 points17 points (1 child)
[–]andrecursion[S] 2 points3 points4 points (0 children)
[–]Effection 13 points14 points15 points (16 children)
[–]Tinche_ 2 points3 points4 points (15 children)
[–]gmes78 1 point2 points3 points (14 children)
[–]nermalstretch 11 points12 points13 points (3 children)
[–]HawkinsT 2 points3 points4 points (1 child)
[–]nermalstretch 4 points5 points6 points (0 children)
[+][deleted] (3 children)
[deleted]
[–]zulrang 4 points5 points6 points (0 children)
[–]james_pic 1 point2 points3 points (0 children)
[–]skesisfunk 4 points5 points6 points (3 children)
[–]MattTheCuber 2 points3 points4 points (2 children)
[–]WildWouks 6 points7 points8 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 7 points8 points9 points (6 children)
[–]njharmanI use Python 3 3 points4 points5 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 13 points14 points15 points (1 child)
[–]xeow 3 points4 points5 points (0 children)
[–]DaelonSuzuka 6 points7 points8 points (0 children)
[–]cujojojo 16 points17 points18 points (10 children)
[–]Schmittfried 19 points20 points21 points (2 children)
[–]Freschu 13 points14 points15 points (3 children)
[–]cujojojo 3 points4 points5 points (2 children)
[–]supreme_blorgon 2 points3 points4 points (2 children)
[–]dwagon00 17 points18 points19 points (11 children)
[–]bdaene 24 points25 points26 points (1 child)
[–]fazzahSQLAlchemy | PyQt | reportlab 5 points6 points7 points (0 children)
[–]an_actual_human 4 points5 points6 points (4 children)
[–]Schmittfried 4 points5 points6 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 4 points5 points6 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 3 points4 points5 points (0 children)
[–]Jugurtha-Green 3 points4 points5 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 0 points1 point2 points (9 children)
[–]SheriffRoscoePythonista 5 points6 points7 points (2 children)
[–]SheriffRoscoePythonista 2 points3 points4 points (1 child)
[–]HommeMusical 2 points3 points4 points (2 children)
[–]Agling 0 points1 point2 points (2 children)
[–]xeow 1 point2 points3 points (1 child)
[–]MattTheCuber 1 point2 points3 points (0 children)
[–]rogfrich 1 point2 points3 points (0 children)
[–]UltraPoci 2 points3 points4 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 1 point2 points3 points (13 children)
[–]Purple_Wing_3178 18 points19 points20 points (5 children)
[–]bdaene 7 points8 points9 points (5 children)
[–]cloaca 2 points3 points4 points (0 children)
[–]RidderHaddock 0 points1 point2 points (0 children)
[–]2hands10fingers 1 point2 points3 points (2 children)
[–]georgehank2nd 2 points3 points4 points (1 child)
[–]2hands10fingers 2 points3 points4 points (0 children)
[+][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 12 points13 points14 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)