« first day (3138 days earlier)      last day (1810 days later) » 

5:00 PM
@ParitoshSingh Thanks for that. That's some pretty terse text to get through in general :)
 
@DeveshKumarSingh See relevant PEP, use cases are discussed here
 
With any luck, the users clueless enough to misuse it will also be too clueless to know it exists
 
a simpler example on how it can be misused?
 
If it harms readability instead of helping readability, it's a misuse
 
that ^
it should fit naturally into the syntax, not have to be shoehorned in there
like that guy is doing
 
wim
5:02 PM
it does not fit naturally into the syntax, ever.
this is copying a mistake from other inferior languages such as PHP
 
Maybe I'm being too harsh with my phrasing of " users clueless enough to misuse [assexp]". If the rubric for misuse is as vague as "does it look nice?", then there's going to be a lot of variation among bright well-meaning programmers about what looks nice and what does not look nice.
You don't have to be clueless to write expression soup, but it helps
 
really? I thought the arguments that allow DRY were pretty solid. And nesting genexps to get over having to use it is also less efficient
 
wim
assignment being statement only fits nicely into the Python datamodel (just names and objects) and makes the language simple and easily understandable.
 
The issues will be incorrect use leading to wierd behaviour? Like a lot of newbies doing a=b for mutable objects a and b and then changing a?
 
okay okay, I know we've discussed this before. Let's not open pandora's box. Agree to disagree? :p
 
5:04 PM
@DeveshKumarSingh It shouldn't lead to bad behavior. if a = b: is still illegal syntax, so it's hard for newbies to accidentally use assignment expressions.
Unlike, say, C++, where if (a = b){ is legal and a frequent cause of newbie bewilderment
 
wim
allowing assignment as an expression is a needless complication, throws away all this beauty and simplicity, and was presenting only dubious use-cases as rationale
 
I can tell you who'd eat up assexprs? Code golfers.
 
The fact that the assignment expression operator, :=, is syntactically distinct from the regular assignment operator, =, has assuaged a lot of my fears about the feature
 
41 40 characters, nom nom nom (eating sounds)
 
@cs95 real code golfers should solve their challenges without ever binding a name ;-)
 
5:08 PM
So if I want to try to wrap my head around this example here
 
ooh, shots fired :p
 
if (n := len(a)) > 10:
    print(f"List is too long ({n} elements, expected <= 10)")
how does it work?
 
I'm working on a new language called "mindScript". What it does is read the mind of the coder and does what the coder intended. Once I get this working I'll be able to golf the yam out of stuff. Everything will be one character (or zero, I haven't decided).
 
if (n := len(a)) > 10: is equivalent to "evaluate len(a), assign the returned value to n, then compare the value against > 10"
 
it evaluates len(a), assigns it to n, and then n>10 is checked?
 
5:09 PM
@piRSquared Can't wait to be the author looking back at my code 2 weeks later
 
wim
how is that better than having the assignment on previous line?
 
so it is equivalent to this
In [7]: n = len(a)
   ...: if (n > 10):
   ...:     print(f"List is too long ({n} elements, expected <= 10)")
   ...:
List is too long (11 elements, expected <= 10)
 
I kinda maybe like that use of assex
I don't like the possibility of misuse/abuse
 
they just squashed the conditional and assignment in one statement
 
wim
@DeveshKumarSingh no
 
5:11 PM
I viewed := useful in any situation where I needed to operate on the result of stuff and really wanted to do it in one line.
 
@DeveshKumarSingh Put the n = len(a) before the if. With your code, n won't exist unless the > 10 comparison succeeds. An assignment expression creates n regardless of how it compares to 10.
 
wim
you compute len(a) twice
 
got it, I fixed my example above
 
wim
Python should not add special syntax for "just another way to do the same thing". Smaller language is better.
 
[n:=ord(a) for a in 'ABCDEFG' if n > 68]
 
5:13 PM
Dystopian future: mindScript works and becomes incredibly popular. But a mindScript program only works while the coder is thinking about it. Always-available services require 24/7 shifts of programmers staring at a poster describing the program's features.
 
ohh yes, you are right, my bad! so the output are the values of n then
 
Is there an online repl that gives access to 3.8?
 
@DeveshKumarSingh I would expect it to give [69, 70, 71]
 
or what is easiest way to install 3.8? Why don't I know this stuff?
 
Since E F and G have ordinal values greater than 68
@piRSquared Last I checked, no. I think you need to build it from source.
 
5:16 PM
Does PEP8 give guidance on spacing around :=?
 
In [11]: for a in 'ABCDEFG':
    ...:     n = ord(a)
    ...:     if n > 68:
    ...:         print(n)
    ...:
    ...:
69
70
71
 
Is there a black version that handles 3.8?
 
Source collections conveniently available at python.org/downloads/source
 
Ooh, nice
 
5:18 PM
it's also a matter of how quickly people adept to this syntax, this one liners are slightly easy to comprehend in assex I think
 
@Kevin I made some changes to the riddle spoiler CSS. Things like links and code snippets are now properly hidden
 
I don't comprehend incomprehensible comprehensions.
 
recbg
 
@Aran-Fey Nice work. I thought opacity might do the trick, but my first couple of attempts weren't fruitful.
 
I've posted this before, but I'm posting it again because I want to link it from the new Riddle page (last time I posted the riddle on pastebin and the link expired):
# Find a builtin class (and a corresponding argument tuple) that returns an
# instance of a subclass when it's called. For example, if `int('True')` returned
# a boolean, it would be a solution to this puzzle.

...  # your code here
cls = ...  # your code here
args = ...  # your code here

assert isinstance(cls(*args), cls), "Calling that class didn't return an instance of that class"
assert type(cls(*args)) is not cls, "Calling that class returned a direct instance of that class"
print('You win!')
 
5:23 PM
[n for n in b'ABCDEFG' if n > 68] # :)
 
or [n for n in 'ABCDEFG'.encode() if n > 68]
 
I think these new features will give future SO Python answerers multiple ways to answer the same question :)
 
which will break the heck out of "There should be one-- and preferably only one --obvious way to do it."
 
Guido apparently got sick of people quoting Zen of Python at him as an argument point against assexprs, lol
 
Hey, I'm trying to make an executable from a python script with pyinstaller but i get a nomodule error. Can you recommand me a tutorial?
 
5:29 PM
"There should be one..." is one of the less essential zens in my opinion
 
ModuleNotFoundError: No module named 'pyautogui'
 
 [n for n in ''.join([chr(ord('A')+i) for i in range(7)]).encode() if n > 68]
 
@Kevin It's like any religious text, I pick the parts I like
 
To those of you not using more namespaces -- j'accuse
 
hey guys
 
wim
5:32 PM
from datetime.datetime.datetime import datetime
 
noob question here
how can i make a input accept only numbers?
i've tried the following:
jogada = input("Informe o número do quadrado no qual deseja jogar: ")
	try:
		jogada = int(jogada)
	except:
		pass
	else:
		raise ValueError("Informe um quadrado válido!")
 
what!!
Python 3.8.0a4 (v3.8.0a4:c1004b8546, May  6 2019, 16:50:16)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [n:=ord(a) for a in 'ABCDEFG' if n > 68]
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<stdin>", line 1, in <listcomp>
NameError: name 'n' is not defined
 
@HenriqueHBR I wrote a question about this topic: Asking the user for input until they give a valid response
 
what value should I pick for n here?
 
try jogada.isdigit()
 
5:34 PM
I think it should be enclosed in parentheses (n:=ord(a)) but could be mistaken
 
@HenriqueHBR what is the problem?
 
@DeveshKumarSingh That's unusual. I would expect that code to run without crashing.
 
if jogada.isdigit():
 
3.8 is still in development so it may not be behaving according to specifications
 
@DragosVasile does isdigit support negative numbers?
 
5:35 PM
... Or maybe I misunderstood how assexps work???
 
List comprehensions run in whole new scope, right? So n will be local to that scope and not accessible outside of the comprehension?
 
@Kevin Perhaps, but it's one of the main reasons I love Python. It speeds up code development because you're less likely to mess around with several similar ways to do stuff. And it makes it easier to read (good) code, because you soon get used to reading the more common idioms. Conversely, it makes newbie / awkward code obvious because it's not using the standard idioms.
 
Next PEP: The nonlocal keyword can now be used in comprehensions
 
@DeveshKumarSingh I'd expect it to be UnboundLocalError
 
I get a nameerror
 
5:36 PM
@Kevin thanos bless you bud, thanks!
 
I know
 
@Aran-Fey I think assexps are an exception to that. One of the use cases is so you can call any(x:=i for i in blah) and examine x to see the first truthy value.
 
wim
@Kevin opinions differ. one of the best ones, I think.
 
I just realized I misunderstood the problem. Nobody's even trying to access n outside of the comprehension.
 
... Or maybe that any example only works because it's not using a list comp? Dunno
 
5:37 PM
though this does work
>>> [n := ord(a) for a in 'ABCDEFG']
[65, 66, 67, 68, 69, 70, 71]
so assexp is there for sure,
 
@vaultah isdigit works only with digits
'123' and not '-123'
 
The if part of the comprehension is executed before the n := part, so it makes sense that it doesn't work. But I agree with vaultah that it should raise UnboundLocalError and not NameError
 
@DeveshKumarSingh What happens if you do print(n) after that line?
Perhaps you can settle the question that Aran-Fey and I have
 
@DragosVasile well yes, meaning it would fail cases that int wouldn't fail
 
Python 3.8.0a4 (v3.8.0a4:c1004b8546, May 6 2019, 16:50:16)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> [n := ord(a) for a in 'ABCDEFG']
[65, 66, 67, 68, 69, 70, 71]
>>> n
71
 
5:39 PM
Ah, so this suggests that assexps in a list comprehension are visible outside of the list comprehension
 
so n is not local
 
But the n in if n > 68 is looking for n in global scope
 
>>> [a for a in range(5)]
[0, 1, 2, 3, 4]
>>> a
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined
 
wtf moment for me
 
So assexps are actually the first mechanism in the language that allows us to create names in surrounding scopes. Somebody get on creating a riddle based on that.
 
5:40 PM
this is obvious right, since the loop variable is local to list comprehension, but the variable assigned in assexp is not local
 
My guess is: the "iterating name" is local to the list comp, but all other assignments are local to the enclosing scope. For example, in [n := ord(a) for a in 'ABCDEFG'], the iterating name a is local to the list comp scope, and n is not local to the list comp scope.
 
I can see sadistic professors setting multiple choice quizzes based on these idiosyncrasies
 
yes the iterating name a is local to the list comp scope is something from 3.7, and n is not local to the list comp scope. is a decision made for 3.8
 
What does the following code do: (1) print <expected output> (2) print error (3) all of the above (4) none of the above
or better still (3) none of the above (4) all of the above
 
the riddle now is to get that list comp by @Kevin to work :)
 
5:44 PM
@piRSquared Not yet I don't think, but PEP 572 says "This PEP recommends always putting spaces around :="
I expect it will get folded into PEP 8 during 3.8's release
 
On the topic of weird behaviour. . .
In [63]: df
Out[63]:
   a  b
0  x  1
1  y  2

In [64]: df.set_index([['x', 'y']])
Out[64]:
   a  b
x  x  1
y  y  2

In [65]: df.set_index(map(str, ['x', 'y']))
Out[65]:
   a  b
x  x  1
y  y  2

In [66]: df.set_index(['x', 'y'])
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
In [67]: pd.__version__
Out[67]: '0.25.0.dev0+590.g44d5498d8'
abc.Iterator is treated differently from 1D lists
 
@DeveshKumarSingh Try this: [n for a in 'ABCDEFG' if (n := ord(a)) > 68]
 
>>> [n for a in 'ABCDEFG' if (n := ord(a)) > 68]
[69, 70, 71]
bingo
I guess the if condition is evaluated by the assex
 
You can't do an if test on n before it exists.
 
@cs95 Pandas decision to treat 1D lists as lists of column names. Try with set_axis
 
5:48 PM
similar to the example in pep-572
 
Things like this make me glad I don't have to work with pandas
 
@piRSquared Yep. What I find odd about set_axis is that inplace=True by default, other than that I have no beef with it
 
I thought there was a warning that that will change to False
 
@DeveshKumarSingh Sounds backwards to me. It's the if condition that evaluates the assex, not the other way around
 
Yeah "FutureWarning: set_axis currently defaults to operating inplace.
This will change in a future version of pandas, use inplace=True to avoid this warning."
 
5:50 PM
yes, you are right @Kevin
 
ooh, didn't see that. Wonder why
Good. They're fixing it, then :P
 
#it makes more sense if you write it out longhand.
result = [EXPR for VAR in ITERABLE if CONDITION]

#is equivalent to
result = []
for VAR in ITERABLE:
    if CONDITION:
        result.append(EXPR)

#so therefore this:
result = [n := EXPR for VAR in ITERABLE if CONDITION]

#is equivalent to this:
result = []
for VAR in ITERABLE:
    if CONDITION:
        n = EXPR
        result.append(n)

#if your CONDITION mentions `n`, then naturally it will crash because `n` only gets created after the conditional occurs.
 
yes, makes sense, thanks @Kevin
>>> [n for a in 'ABCDEFG' if (n := ord(a)) in [69,70,71]]
[69, 70, 71]
>>> [n for a in 'ABCDEFG' if ((n := ord(a)) > 68 and ((n := ord(a)) < 72))]
[69, 70, 71]
 
wim
ugly, ugly, ugly
 
not that bad, just need to count the brackets lol
 
5:53 PM
I won't call it obvious behavior because I looked at it confusedly for fifteen minutes before PM clued us in
@DeveshKumarSingh Fairly certain that [n for a in 'ABCDEFG' if ((n := ord(a)) > 68 and n < 72] would work there.
The entire point of assexp is so you don't have to repeat yourself
 
>>> [n for a in 'ABCDEFG' if (n := ord(a)) > 68 and n < 72]
[69, 70, 71]
it does
 
(You could also do [n for a in 'ABCDEFG' if 68 < (n := ord(a)) < 72] but that's not illustrative of the fact that one assexp is sufficient to reference n more than once in the conditional)
 
yes, and since conditional expressions are evaluated left to right
[n for a in 'ABCDEFG' if n > 68 and (n:=ord(a)) < 72]
is a syntax error
 
@wim I agree! That is gross.
 
That's not a syntax error
 
5:58 PM
sorry, I should say name error
n is not defined
 
what about [n for a in 'ABCDEFG' if (n:=ord(a)) > 68 and n < 72]
 
>>> [n for a in 'ABCDEFG' if (n:=ord(a)) > 68 and n < 72]
[69, 70, 71]
yes it works
 
wim
@Kevin There are already better ways to not repeat yourself. Write a for-loop.
 
The goal is DRY while also golfing code
 
wim
since when was golfing code a goal of Python
 
6:01 PM
@wim You're preaching to the choir :-)
(expect when I find myself wanting to do if m := re.match(...))
 
Hold on, I sing several choirs tho.
 
wim
the whole thing is just chr(128169)
 
sure, I can try it, give me what you want to run @Kevin
 
wim
plain old for-loop is clear, readable, maintainable ... I don't like ramming too much logic into list comprehensions
 
@DeveshKumarSingh For this one, I'm going to wait to test it personally ;-)
I want that new feature satisfaction
 
6:02 PM
haha okay as you wish
 
>>> '\N{badger}'
'🦡'
>>> '\N{poo}'
  File "<stdin>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 0-6: unknown Unicode character name
 
wim
this gonna encourage people who try to be clever just for the sake of being clever
 
python I am disappoint
 
When the syntax lends itself to increased readability, I can get on board. Who has a viable example. Let's try that. Come up with an example in which the use of this syntax increases readability.
 
will be fun to see new python learners see things like
[ i := i+j for i in [ j := j+1 for j in range(10)]]
 
6:05 PM
The poo emoji only responds to his full name, '\N{PILE OF POO}'
 
>>> '\N{PILE OF POO}'
'💩'
 
@DeveshKumarSingh Oh, I'm surprised that's legal. I thought PEP 572 forbids rebinding for loop targets.
 
@DeveshKumarSingh gah, so close
 
> an assignment expression target name cannot be the same as a for-target name appearing in any comprehension containing the assignment expression
Maybe they haven't gotten around to implementing that part yet.
 
@Kevin Poo of house Pile
or is it Pile of house Poo
 
6:07 PM
>>> [i := i+1 for i in range(5)]
[1, 2, 3, 4, 5]
It is valid, yes maybe still not in this build
 
Let the buyer beware when they use a development version
 
Mind that we can come up with monstrosities without :=. Just because we can be gross with syntax doesn't make the syntax bad.
 
I know, I was just playing around
 
@cs95 Good question. Would the other members of its family be piles of non-poo things? Or poo in shapes other than a pile?
 
@Kevin why is having this a problem, what issues can it cause?
 
6:10 PM
I suspect it would cause confusing behavior, the same way that code like this does now:
for i in range(10):
    print(i)
    i += 1
New users expect this to print 0, 2, 4, 6, etc. But actually it prints 0,1,2,3,4, etc.
 
because i in print is local to the inside of for loop, and the i of for loop is local to for loop, so there are two i
well than shouldn't this be illegal too?
>>> [n for a in 'ABCDEFG' if (n:=ord(a)) > 68 and n < 72]
[69, 70, 71]
>>> n
71
 
"i in print is local to the inside of for loop". Not really. For loops don't get their own scope.
 
n can be access outside the list comprehension, the same way j was accessible outside the inner list comprehension, or are they two different things
 
@DeveshKumarSingh I would expect that to error with 'j is not defined'
 
okay, the same with n is not defined if you try to access n outside the list comprehension right
 
6:14 PM
The i defined by the loop has the same scope as the i bound by the i += 1 statement. It just so happens that range(10) doesn't give a dang about what i's previous value is, it's going to steamroll over it and assign the next number it's got regardless
 
@DeveshKumarSingh What's the error message for this? [a for a in 'ABCDEFG' if (a:=ord(a)) > 68]
 
the features are almost merged, and this python3.8 is dated May 6th, I would then assume the j is not defined feature is in there
no error lol
>>> [a for a in 'ABCDEFG' if (a:=ord(a)) > 68]
[69, 70, 71]
which is expected ?
 
Ok. That's a pretty clear violation of the thing Kevin quoted at chat.stackoverflow.com/transcript/message/46269760#46269760
 
I would expect something like SyntaxError: assexp and for loop can't use the same name
 
6:20 PM
a way to check last commit of the python build from python REPL?
 
I don't suppose it's visible in the sys.version string?
No idea how dev builds do this sort of thing
 
>>> sys.version
'3.8.0a4 (v3.8.0a4:c1004b8546, May  6 2019, 16:50:16) \n[Clang 6.0 (clang-600.0.57)]'
it is
 
wim
@piRSquared This is true. But what makes the syntax bad is that there are already better ways to do the same thing, so the feature adds no value.
 
well you can surely think of ways to make a list of first 10 positive integers with these nested loops in assexp
>>> [ i := i//j for i in [ j := j+1 for j in range(-11,-1)]][::-1]
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
I see how people can mess with it and ask questions on why is this behaving the way it is
 
that is headache inducing
 
6:29 PM
haha, I am just starting to have fun with assexps, you can do wonders with these things, and this are the simplest examples
 
Classic riddles reposted #3: Using a single statement, create a self-referential list a such that a is a[0].
 
Using python3.8?
 
no, pre 3.8
 
Whatever version you want.
 
or well, why dont you go for it in 3.8
 
That is the intended pre-3.8 solution :-)
I suspect 3.8 lets you do view spoiler but I don't find that as fun.
Partial credit awarded for view spoiler
 
okay that is fiendishly clever
i dont get why the multiple assignment one worked
 
assignments happen from left to right
 
>>> a = a[0] = [0]
>>> a == a[0]
True
how does this work?
 
a[0] is a
take it that one extra step. :P
 
6:40 PM
>>> a[0] is a
True
 
now, try a[0][0][0][0].... and you'll get the idea :P
 
If you're asking "wouldn't it take an infinite amount of memory to represent a list that contains a list that contains a list that contains a list that contains a list that (...)?", it doesn't if you use pointers
 
wim
@DeveshKumarSingh if someone put their answer in spoiler text maybe you shouldn't copy and paste it directly, duh .
 
a = ['whatever']
a[0] = a
It's like ^ that but on one line
 
wim
nice riddle
 
6:41 PM
clear memory and try again
 
wim
I wonder if you can do it with a for statement too
 
i am not sure that would work out of the box since a doesn't exist.
 
wim
can R.O trash devesh recent messages pls (and this one)
 
knife all the spoilers (except those that are properly hidden, duh)
 
haha, @wim I honestly did not look at the spolier
 
wim
6:43 PM
yeah I was just looking at this and it was already spoiled. have some common sense man.
 
ohh sorry, you mean I shouldn't have posted the solution
my bad! @wim
 
at least not as painful to read as endgame spoilers
 
@wim I've got another riddle to repost, and I think you'll enjoy this one:
# Complete the following function, which checks whether all iterables in
# the input list are empty. Your function may not use any variables or other
# functions (including lambdas).

def empty_test(list_of_iterables):
    ... # your code here

assert empty_test(['', (), {}, iter([])]) == True
assert empty_test(['foo']) == False
 
@cs95 oof, i can relate to that one :P
 
I would like to thank modern browsers for knowing what I meant when I incorrectly typed <span class="spoiler"> text goes here </spoiler> ten times in a row
 
6:49 PM
I guess that explains why it wouldn't let me add <p> paragraphs inside a spoiler
 
How do I write spoiler text?
 
It only works on sopython.com/wiki/Riddles because we defined CSS for it specifically :-)
Writing spoiler text in here can be accomplished using either of the spoiler button adder userscripts at sopython.com/wiki/Userscripts, or by using sopython.com/spoiler directly (... Once we fix the buggy submit button)
 
I think I got it
 
Ah that's what the issue was. Submit button wasn't working when I tried it just now
Did Aran use a userscript for the spoiler he posted as well?
@Kevin fix it pls I am not a userscript guru :p
 
hover-style spoilers can be written manually using the secret alt text property of regular links
 
6:53 PM
Nope, that was just markup
May 7 at 18:17, by vaultah
[text](https://link.com "alt text (or spoiler)")
 
nice, that worked
 
The gist.github.com/kms70847/29ea39da5dc80b38eb2a353149185193 userscript also comes in convenient bookmarklet form, no extensions/addons required
 
does that count or no?
 
Hover spoilers are suboptimal on phones...
 
!! feature request? Hover on phones
 
6:56 PM
 
ah but this is probably the wrong room for that
 
the quotes part..as you can probably see now.
 
@ParitoshSingh Nope - you're not allowed to use functions, and that also checks the truthiness of the elements. It's supposed to check if the iterable is empty
 
@DeveshKumarSingh you need a 3rd assert perhaps. try assert empty_test([iter([])]) == True
 
6:59 PM
hah fail!
 
@DeveshKumarSingh Again, you're checking truthiness - not emptyness
 
yes, same mistake as Paritosh
 
What am I missing here? Devesh's link sends me to a holding page.
 
@Aran-Fey it took me a few seconds to even realise what you were referring to.
@roganjosh hover, not click :P
 
Oh, man. I've just finished the last episode of GoT and apparently my mind has melted
 
7:02 PM
I think this one's really hard to figure out, so here's a hint: Python lets you assign to a single variable, or multiple variables at the same time. The solution is related to that.
 
yeah, i dont think im getting this one. love the puzzle
 
I recommend using example.com for alt text spoilers, since that url is very unlikely to get hijacked by cybersquatters
 
but now you've said it..
 
The example.com login credentials are held within a locket in the possession of Tim Berners-Lee and any would-be cybersquatter would have to defeat him in a kung fu battle to get it
 
7:06 PM
 
./pat cs95 on the head.
 
I vaguely suspect that view spoiler is involved here somehow
 
how are you able to make those spoilers kevin, and can we make them in that way too atm or no?
 
@cs95 Tis the death of expectations from me. What a mess.
 
16 mins ago, by Kevin
Writing spoiler text in here can be accomplished using either of the spoiler button adder userscripts at https://sopython.com/wiki/Userscripts, or by using https://sopython.com/spoiler/ directly (... Once we fix the buggy submit button)
The submit button is buggy but the decryptor is working fine
 
7:09 PM
@Kevin That would probably work, but there's one problem
nvm, I forgot about the 2nd half of that sentence. Disregard whatever I said
It's not the solution I had in mind, but it might work
 
@cs95 The front page of SF&F is currently flooded with GoT questions. But I guess that's not so unusual.
 
Shouldn't those go on movies.se?
 
@cs95 I enjoyed the ending
 
@PM2Ring The urge for me to vent is almost overpowering.
 
(P.S.: I have never watched a single episode in my life)
I am only in it for the memes
 
7:13 PM
@cs95 Cuz I you watch them in pairs (-;
 
I watched season 1 and the finale. I think I got the gist.
 
rofl kevin
 
Lol, I haven't done that either. It is on my PTW list but it is pretty far down
 
might want to resist the urge to talk here, i'd recommend deleting anything that could make watching the episode itself a poorer experience for anyone
 
don't worry, I know so little about GoT that I wouldn't be able to recognise a spoiler if it stared me in the face
 
7:17 PM
It's fair enough. I shall diminish and go into the West
 
As for Aran, you've got me stumped good. and this time, i can't even placate myself by using my lack of knowledge about classes in python as an excuse. :(
 
@roganjosh if you were to write a song about your trip west, consider a lengthy one. Maybe even an aria
 
@Aran-Fey, using a somewhat liberal interpretation of "you may not use any variables or other functions", pastebin.com/vUTRF7VW
 
@piRSquared old ro roganjosh, roganjosh-a-dillo is my effort on that side
 
@Kevin I suppose that matches the spec as written. I didn't account for recursion... need to be more explicit about that
 
7:24 PM
Yeah, my "this is not adhering to the spirit of the challenge" detector was buzzing as I wrote my approach
At least it's not quite as bald-faced-ly flaunting the spirit, compared to my usual flauntings
I do like that intended solution.
 
does that count or no? doesn't use your hint though
 
wim
@Aran-Fey I did spoiler but not sure if that's cheating on the "any variables" thing.
 
@ParitoshSingh Nope, next and iter are both functions :)
 
I suspect Paritosh falls afoul of "no other functions" and wim falls afoul of "no variables"
 
@Aran-Fey oh gosh haha
its so hard to even mentally parse them as functions you know :P
 
wim
7:29 PM
I liked the recursive list riddle because the solution is pretty much just writing down what you wanted to happen in the first place. Like wishful thinking.
 
Programming is all about wishing. Just remember that the genie gives you a horrible fate if you don't word things very carefully.
 
@wim Yeah, it was supposed to be solved without any comprehensions. I actually had a couple assertions that would fail those kinds of solutions, but I omitted those for brevity and forgot to account for comprehensions in the description
 
wim
@Aran-Fey hah, nice
 
I've discarded a riddle more than once while in the throes of "I know there's an elegant problem statement that disqualifies all the dumb sneaky approaches, I just can't find it"
Why else compose a riddle, if not so you can solve the many meta-riddles that riddle composition entails?
 
i gave up and peeked. That's wicked!
 
7:36 PM
@wim isqrt answer has been deleted. I thought about adding an answer with it minus assexprs myself but I see the function isn't available on the prerelease yet
 
wim
I'll edit it into accepted answer when 3.8 is final
 
sounds good
 
wim
does the stdlib impl use newtons method too?
 
Not familiar with Newton's method, but PR is here
Indeed it does use Newton's method
 
wim
found a fun new way to annoy people... half-triple quoted docstrings
def my_method():
    "the docstring"""
It works™!
 
7:43 PM
only in a single line :P
 
wim
>>> x, y = x[y] = {}, 0
>>> x
<you guess the output>
^ puzzle inspired by Kevin's
 
wim
@Aran-Fey impressive
it kinda looks like a koala bear emoji
 
I'll admit I almost screwed it up... made a last-second fix before submitting
 
7:51 PM
I guessed wrong :<
 
wim
no shame...wrong guesses should be posted
 
Ok. I thought it was hover
Another fifteen seconds of thinking before pasting the expression into my REPL would probably have saved me
 
I was about to post the same thing before my brain was like "wait a second... that's not quite right"
 
1. post these puzzles on the site
2. enter catchy/clickbait title (is python broken!??!?!?)
3. ???
4. profit (AKA, HNQ)
 
Anyone that posts my puzzles for a quick rep boost must square against me in the Battle Dome
I will be swinging chains around recklessly and there will not be tetanus shots on site
 
7:55 PM
i am not able to grasp the assignment order
 
if by chains you're referring to instances of itertools.chain then I think tetanus shots aren't necessary
 
My use of itertools can be described as reckless. There's a certain air of "hold my beer" there.
groupby is my bludgeon of choice in that category though
 

« first day (3138 days earlier)      last day (1810 days later) »