MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/fjk6u1/sort_algorithm/fy6b2vi?context=9999
r/ProgrammerHumor • u/Hamstorian • Mar 16 '20
614 comments sorted by
View all comments
3.8k
If she's doing bucket sort at this age, then she's set.
776 u/SharkLaunch Mar 16 '20 But sets are unordered 135 u/Raydan4 Mar 16 '20 Except sometimes if you are using python and you have a set of integers 54 u/thegodzilla25 Mar 16 '20 Aren't python sets also unordered though? I dont understand what you mean. 41 u/Raydan4 Mar 17 '20 Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior. 3 u/[deleted] Jul 15 '20 PSA: Please do not rely on this in your code 2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
776
But sets are unordered
135 u/Raydan4 Mar 16 '20 Except sometimes if you are using python and you have a set of integers 54 u/thegodzilla25 Mar 16 '20 Aren't python sets also unordered though? I dont understand what you mean. 41 u/Raydan4 Mar 17 '20 Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior. 3 u/[deleted] Jul 15 '20 PSA: Please do not rely on this in your code 2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
135
Except sometimes if you are using python and you have a set of integers
54 u/thegodzilla25 Mar 16 '20 Aren't python sets also unordered though? I dont understand what you mean. 41 u/Raydan4 Mar 17 '20 Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior. 3 u/[deleted] Jul 15 '20 PSA: Please do not rely on this in your code 2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
54
Aren't python sets also unordered though? I dont understand what you mean.
41 u/Raydan4 Mar 17 '20 Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior. 3 u/[deleted] Jul 15 '20 PSA: Please do not rely on this in your code 2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
41
Technically yes, but the way that hashing integers works, in standard python, integers are added to sets in order, at least most of the time. Implementations of python like pypy do not have this behavior.
3 u/[deleted] Jul 15 '20 PSA: Please do not rely on this in your code 2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
3
PSA: Please do not rely on this in your code
2 u/Raydan4 Jul 16 '20 Well obviously, that’s not what sets are for → More replies (1)
2
Well obviously, that’s not what sets are for
3.8k
u/theeggman84 Mar 16 '20
If she's doing bucket sort at this age, then she's set.