MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/igvny1/python_goes_brrrr/g2wgihf
r/ProgrammerHumor • u/das_freak • Aug 26 '20
789 comments sorted by
View all comments
Show parent comments
164
''.join(itertools.product('abc', 'de')) If you want me to fix it submit a ticket, thanks.
edit: Ticket assigned, standby.
import itertools as it ''.join(it.chain.from_iterable(it.product('abc', 'de')))
108 u/Rasmaellin Aug 26 '20 (concat .) . liftA2 ((. flip (:) []) . (:)) 0 u/[deleted] Aug 26 '20 [deleted] 207 u/Andy_B_Goode Aug 26 '20 haha, perl goes @_->{$_} 52 u/RiddSann Aug 26 '20 Two letters : TFAs in, "tf is that shit that you've written". Seriously though, if Pearl uses that, I'm impressed by how opaque it seems 70 u/Andy_B_Goode Aug 26 '20 Yeah, that's why it's been called a "write-only language". Good luck reading it!Also, I tried running the example I used, and it gave me an error, but this:\@_{$_};Ran just fine. 6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything. 0 u/[deleted] Aug 26 '20 [deleted] 30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;" 3 u/Uipncspn Aug 26 '20 I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through 6 u/[deleted] Aug 26 '20 that makes perfect sense goddamnit. the named contextual element of the contextual hash array. :) 4 u/cosmicosmo4 Aug 26 '20 edited Aug 26 '20 Is ¯\(ツ)/¯ valid perl? → More replies (5) 29 u/Eiim Aug 26 '20 haha, golfing languages go ≔⟦⟧θWS⊞θι⊞υ⟦⊕Nω⟧≔⁰ηFυ«⪫θ¶←F§ι¹✳κ+¿∨ⅈⅉFruld«≔⌕….#§ι⁰∨⊟KD²✳κ+ζ¿⊕ζ⊞υEι⁺λ⎇μκ±ζ»≔¹η⎚»η 4 u/Phlosen Aug 26 '20 ( . ) ( . ) 6 u/bistr-o-math Aug 26 '20 r/upvotedbecauseboobs 3 u/Rasmaellin Aug 26 '20 (.) ((.) (flip (>>=) id)) ((.) (<*>) ((<$>) ((.) (flip (.) (flip (:) [])) (:)))) → More replies (1) 12 u/jeremj22 Aug 26 '20 \xs ys -> concat [ x:y:[] | x<-xs, y<-ys ] → More replies (1) 4 u/deeplearning666 Aug 26 '20 How about a patch?< "".join(itertools.product("abc", "de")) --- > "".join(map(lambda t: t[1] + t[0], itertools.product("de", "abc"))) 3 u/[deleted] Aug 26 '20 Alternate patch submitted for your review. 2 u/murtaza64 Aug 26 '20 Does * unpacking not work with non-sequence iterables? 2 u/[deleted] Aug 26 '20 Works afaik. How were you planning on using it? 2 u/murtaza64 Aug 26 '20 ''.join(it.chain(*it.product('abc', 'de')))unless from_iterable is considered more Pythonic 4 u/[deleted] Aug 26 '20 Both do essentially the same thing, but from_iterable is the lazier method. Neither really seems more pythonic imo. → More replies (1)
108
(concat .) . liftA2 ((. flip (:) []) . (:))
0 u/[deleted] Aug 26 '20 [deleted] 207 u/Andy_B_Goode Aug 26 '20 haha, perl goes @_->{$_} 52 u/RiddSann Aug 26 '20 Two letters : TFAs in, "tf is that shit that you've written". Seriously though, if Pearl uses that, I'm impressed by how opaque it seems 70 u/Andy_B_Goode Aug 26 '20 Yeah, that's why it's been called a "write-only language". Good luck reading it!Also, I tried running the example I used, and it gave me an error, but this:\@_{$_};Ran just fine. 6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything. 0 u/[deleted] Aug 26 '20 [deleted] 30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;" 3 u/Uipncspn Aug 26 '20 I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through 6 u/[deleted] Aug 26 '20 that makes perfect sense goddamnit. the named contextual element of the contextual hash array. :) 4 u/cosmicosmo4 Aug 26 '20 edited Aug 26 '20 Is ¯\(ツ)/¯ valid perl? → More replies (5) 29 u/Eiim Aug 26 '20 haha, golfing languages go ≔⟦⟧θWS⊞θι⊞υ⟦⊕Nω⟧≔⁰ηFυ«⪫θ¶←F§ι¹✳κ+¿∨ⅈⅉFruld«≔⌕….#§ι⁰∨⊟KD²✳κ+ζ¿⊕ζ⊞υEι⁺λ⎇μκ±ζ»≔¹η⎚»η 4 u/Phlosen Aug 26 '20 ( . ) ( . ) 6 u/bistr-o-math Aug 26 '20 r/upvotedbecauseboobs 3 u/Rasmaellin Aug 26 '20 (.) ((.) (flip (>>=) id)) ((.) (<*>) ((<$>) ((.) (flip (.) (flip (:) [])) (:)))) → More replies (1) 12 u/jeremj22 Aug 26 '20 \xs ys -> concat [ x:y:[] | x<-xs, y<-ys ] → More replies (1)
0
[deleted]
207 u/Andy_B_Goode Aug 26 '20 haha, perl goes @_->{$_} 52 u/RiddSann Aug 26 '20 Two letters : TFAs in, "tf is that shit that you've written". Seriously though, if Pearl uses that, I'm impressed by how opaque it seems 70 u/Andy_B_Goode Aug 26 '20 Yeah, that's why it's been called a "write-only language". Good luck reading it!Also, I tried running the example I used, and it gave me an error, but this:\@_{$_};Ran just fine. 6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything. 0 u/[deleted] Aug 26 '20 [deleted] 30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;" 3 u/Uipncspn Aug 26 '20 I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through 6 u/[deleted] Aug 26 '20 that makes perfect sense goddamnit. the named contextual element of the contextual hash array. :) 4 u/cosmicosmo4 Aug 26 '20 edited Aug 26 '20 Is ¯\(ツ)/¯ valid perl? → More replies (5) 29 u/Eiim Aug 26 '20 haha, golfing languages go ≔⟦⟧θWS⊞θι⊞υ⟦⊕Nω⟧≔⁰ηFυ«⪫θ¶←F§ι¹✳κ+¿∨ⅈⅉFruld«≔⌕….#§ι⁰∨⊟KD²✳κ+ζ¿⊕ζ⊞υEι⁺λ⎇μκ±ζ»≔¹η⎚»η 4 u/Phlosen Aug 26 '20 ( . ) ( . ) 6 u/bistr-o-math Aug 26 '20 r/upvotedbecauseboobs 3 u/Rasmaellin Aug 26 '20 (.) ((.) (flip (>>=) id)) ((.) (<*>) ((<$>) ((.) (flip (.) (flip (:) [])) (:)))) → More replies (1)
207
haha, perl goes @_->{$_}
52 u/RiddSann Aug 26 '20 Two letters : TFAs in, "tf is that shit that you've written". Seriously though, if Pearl uses that, I'm impressed by how opaque it seems 70 u/Andy_B_Goode Aug 26 '20 Yeah, that's why it's been called a "write-only language". Good luck reading it!Also, I tried running the example I used, and it gave me an error, but this:\@_{$_};Ran just fine. 6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything. 0 u/[deleted] Aug 26 '20 [deleted] 30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;" 3 u/Uipncspn Aug 26 '20 I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through 6 u/[deleted] Aug 26 '20 that makes perfect sense goddamnit. the named contextual element of the contextual hash array. :) 4 u/cosmicosmo4 Aug 26 '20 edited Aug 26 '20 Is ¯\(ツ)/¯ valid perl? → More replies (5)
52
Two letters : TF
As in, "tf is that shit that you've written". Seriously though, if Pearl uses that, I'm impressed by how opaque it seems
70 u/Andy_B_Goode Aug 26 '20 Yeah, that's why it's been called a "write-only language". Good luck reading it!Also, I tried running the example I used, and it gave me an error, but this:\@_{$_};Ran just fine. 6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything. 0 u/[deleted] Aug 26 '20 [deleted] 30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;" 3 u/Uipncspn Aug 26 '20 I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through
70
Yeah, that's why it's been called a "write-only language". Good luck reading it!
Also, I tried running the example I used, and it gave me an error, but this:
\@_{$_};
Ran just fine.
6 u/bistr-o-math Aug 26 '20 Run or die; 3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic 3 u/RIcaz Aug 26 '20 Yeah but it's nonsense and doesn't do anything.
6
Run or die;
3 u/MkMyBnkAcctGrtAgn Aug 27 '20 Just needed an extra hieroglyphic
3
Just needed an extra hieroglyphic
Yeah but it's nonsense and doesn't do anything.
30 u/npsimons Aug 26 '20 I read somewhere that python prefers alphabetic keywords while perl prefers symbols.There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;"
30
I read somewhere that python prefers alphabetic keywords while perl prefers symbols.
There's a great Perl module called, appropriately enough, "English". So to enable more readable code, literally "use English;"
I work for a company which has a website made in perl and I can tell you, that above is not even the weirdest shit I’ve come through
that makes perfect sense goddamnit. the named contextual element of the contextual hash array. :)
4
Is ¯\(ツ)/¯ valid perl?
29
haha, golfing languages go ≔⟦⟧θWS⊞θι⊞υ⟦⊕Nω⟧≔⁰ηFυ«⪫θ¶←F§ι¹✳κ+¿∨ⅈⅉFruld«≔⌕….#§ι⁰∨⊟KD²✳κ+ζ¿⊕ζ⊞υEι⁺λ⎇μκ±ζ»≔¹η⎚»η
( . ) ( . )
6 u/bistr-o-math Aug 26 '20 r/upvotedbecauseboobs
r/upvotedbecauseboobs
(.) ((.) (flip (>>=) id)) ((.) (<*>) ((<$>) ((.) (flip (.) (flip (:) [])) (:))))
12
\xs ys -> concat [ x:y:[] | x<-xs, y<-ys ]
How about a patch?
< "".join(itertools.product("abc", "de")) --- > "".join(map(lambda t: t[1] + t[0], itertools.product("de", "abc")))
3 u/[deleted] Aug 26 '20 Alternate patch submitted for your review.
Alternate patch submitted for your review.
2
Does * unpacking not work with non-sequence iterables?
2 u/[deleted] Aug 26 '20 Works afaik. How were you planning on using it? 2 u/murtaza64 Aug 26 '20 ''.join(it.chain(*it.product('abc', 'de')))unless from_iterable is considered more Pythonic 4 u/[deleted] Aug 26 '20 Both do essentially the same thing, but from_iterable is the lazier method. Neither really seems more pythonic imo. → More replies (1)
Works afaik. How were you planning on using it?
2 u/murtaza64 Aug 26 '20 ''.join(it.chain(*it.product('abc', 'de')))unless from_iterable is considered more Pythonic 4 u/[deleted] Aug 26 '20 Both do essentially the same thing, but from_iterable is the lazier method. Neither really seems more pythonic imo. → More replies (1)
''.join(it.chain(*it.product('abc', 'de')))
unless from_iterable is considered more Pythonic
4 u/[deleted] Aug 26 '20 Both do essentially the same thing, but from_iterable is the lazier method. Neither really seems more pythonic imo. → More replies (1)
Both do essentially the same thing, but from_iterable is the lazier method. Neither really seems more pythonic imo.
→ More replies (1)
164
u/[deleted] Aug 26 '20 edited Aug 26 '20
''.join(itertools.product('abc', 'de'))If you want me to fix it submit a ticket, thanks.edit: Ticket assigned, standby.
import itertools as it ''.join(it.chain.from_iterable(it.product('abc', 'de')))