Timeline for C-like structures in Python
Current License: CC BY-SA 3.0
43 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Dec 19, 2024 at 1:52 | comment | added | shea | pretty official answer in the Python Tutorial, mirroring answers below | |
| Sep 22, 2023 at 22:56 | answer | added | Gabriel Staples | timeline score: 0 | |
| Feb 15, 2023 at 10:20 | answer | added | ntg | timeline score: 0 | |
| Dec 25, 2022 at 18:52 | answer | added | Mike 'Pomax' Kamermans | timeline score: 1 | |
| Aug 27, 2021 at 9:04 | comment | added | intellimath | If one were concerned about performance and memory, then recordclass library can provide suitable solution to the problem. | |
| Dec 9, 2020 at 9:08 | comment | added | Basj | If you're concerned about performance (RAM/CPU), then nothing beats a genuine tuple. | |
| Jun 5, 2020 at 10:05 | answer | added | Carson | timeline score: 4 | |
| May 7, 2020 at 14:23 | answer | added | Tioneb | timeline score: 1 | |
| Sep 26, 2019 at 13:56 | answer | added | calandoa | timeline score: 4 | |
| Apr 9, 2019 at 11:10 | answer | added | jochen | timeline score: 5 | |
| Jan 28, 2019 at 11:27 | answer | added | gebbissimo | timeline score: 1 | |
| Dec 11, 2018 at 9:34 | answer | added | שמואל ביאליסטוקי | timeline score: 2 | |
| Dec 2, 2018 at 1:19 | comment | added | Gabriel Staples | Your question itself has the right answer to "C-like structures in Python", or "How to create a struct in Python." After reviewing all of the answers below, I'd say that using a class like you've done is the best way to do it. Using a dictionary is an alternative, and perhaps the second best way to do it. | |
| May 31, 2018 at 18:37 | history | protected | eyllanesc | ||
| May 13, 2018 at 0:13 | comment | added | Navin | Skip to the 2018 answer: stackoverflow.com/a/45426493/703382 | |
| Apr 12, 2018 at 6:17 | answer | added | Oamar Kanji | timeline score: 32 | |
| Mar 29, 2018 at 16:25 | answer | added | PS1 | timeline score: 2 | |
| Nov 6, 2017 at 15:38 | answer | added | normanius | timeline score: 3 | |
| Oct 30, 2017 at 13:40 | answer | added | Galaxy | timeline score: 2 | |
| Aug 5, 2017 at 0:39 | answer | added | simsosims | timeline score: 11 | |
| Jul 31, 2017 at 22:54 | answer | added | Rotareti | timeline score: 624 | |
| Jul 8, 2017 at 19:17 | answer | added | Yujun Li | timeline score: 0 | |
| Nov 8, 2016 at 14:06 | answer | added | Jason C | timeline score: 8 | |
| Sep 8, 2015 at 2:38 | answer | added | ArtOfWarfare | timeline score: 5 | |
| Jun 25, 2015 at 23:50 | answer | added | Ella Rose | timeline score: 25 | |
| Mar 23, 2015 at 14:32 | answer | added | user124757 | timeline score: 6 | |
| Mar 5, 2015 at 1:43 | comment | added | Mark Horvath |
pandas.Series(a=42).a should do it if your a data-scientist...
|
|
| Jan 26, 2015 at 19:44 | comment | added | bx2 | well namedtuple generates a class, so what exactly is the difference? | |
| Nov 9, 2014 at 7:37 | answer | added | Sujal Sheth | timeline score: 9 | |
| Sep 20, 2014 at 13:45 | history | edited | Ben McCormick | CC BY-SA 3.0 |
added colon to function def
|
| Sep 2, 2014 at 22:05 | comment | added | sam boosalis |
@levesque harder to re-factor without typos, harder to read at a glance while skimming code, than MyStruct = namedtuple("MyStruct", "field1 field2 field3")
|
|
| Aug 20, 2014 at 20:58 | comment | added | Kyle Wild | You may find dstruct useful: github.com/dorkitude/dstruct | |
| Sep 13, 2013 at 17:40 | answer | added | Phlip | timeline score: 13 | |
| May 23, 2013 at 19:37 | history | edited | glglgl | CC BY-SA 3.0 |
removed that stuff which proved untrue according to a deleted answer
|
| Sep 21, 2010 at 15:15 | answer | added | Jose M Balaguer | timeline score: 88 | |
| Sep 14, 2010 at 21:32 | comment | added | levesque | Is there anything wrong with this method other than it's tedious to write? | |
| Sep 6, 2010 at 3:03 | comment | added | Edward Z. Yang | Semi-relatedly, algebraic data types would be absolutely wonderful, but to use them well you usually need pattern matching. | |
| Aug 30, 2008 at 15:53 | answer | added | PabloG | timeline score: 19 | |
| Aug 30, 2008 at 15:20 | answer | added | Vicent Marti | timeline score: 28 | |
| Aug 30, 2008 at 15:18 | answer | added | gz. | timeline score: 388 | |
| Aug 30, 2008 at 14:38 | answer | added | dF. | timeline score: 108 | |
| Aug 30, 2008 at 14:35 | answer | added | Mark Biek | timeline score: 73 | |
| Aug 30, 2008 at 14:33 | history | asked | wesc | CC BY-SA 2.5 |