« first day (1466 days earlier)      last day (3487 days later) » 
05:00 - 20:0020:00 - 23:00

8:00 PM
Try out "a" == "x" or "y" and see what the result is
 
Ah, I see it.
I know already >:)
It must be kwargs["hair_colour"] == "brown" or kwargs["hair_colour"] == "blonde", correct?
 
@Iplodman I prefer any(kwargs['hair_color'] == i for i in ('blonde', 'brown'))
 
Without reading the article, I would expect that if var will always return True if not None.
I gte it now c:
 
8:03 PM
@Ffisegydd 'Ello! Also a good solution, and cuts down on my line length of 147 :c
 
Means you can extend it easily for redheads etc
 
DSM
Or simply kwargs['hair_color'] in ('blonde', 'brown')
 
@DSM Brownie points for you, too :P
Not that I have any to give, but still.
@DSM Or, even more simply: kwargs["hair_colour"] in "blonde,brown"
 
DSM
@Iplodman: but then what if I enter "de,br" as my hair colour?
 
8:07 PM
@Dsm sounds like an interesting colour... take it, it's not your * natural* colour though
 
@DSM Then my system will be broken, and you will be a liar!
 
DSM
No, I had to dye it: naturally, I'm boringly dark brown. And any occasional white hairs are just a trick of the light.
 
Hm, still not fixed.
 
DSM
There's always another bug.
 
It seems so.
 
8:12 PM
mscve plz.
Or mcsve, or whatever the acronym is.
 
Can I use if variable_holding_lambda: to evaluate a result?
 
minimum something compilable something something
 
Is there something wrong with that?
 
It's legal syntax, but it always evaluates to True
If you want lambdas to do anything, you have to call them, just as you would a function: if var_holding_lambda():
 
God damn it.
 
DSM
8:13 PM
functions are truelike. Good for them!
 
I'll work this out >:)
I forgot the brackets.
:c
I forgot that lambdas are just like functions (Nearly)! :D
Oh, sorry @Kevin. Your message with the solution didn't come through on my laptop!
 
DSM
...
Then how do you know about it?
 
He's got the Shining!
 
DSM
> Groundskeeper Willy: You've got the Shinning.
Bart Simpson: You mean "Shining".
Groundskeeper Willy: [sotto voce] Shh! You want to get sued?
 
Willie hears ya. Willie don't care.
 
DSM
"Thank you, I love learning just a little more than I hate being wrong :)" All things considered, that's a pretty healthy attitude from someone who was just Martijned.
 
user2260218
Ayo.
 
user2260218
If I have a function that I'm calling from possibly several loops in, how can I break so that it throws control back to the very first loop?
 
You can't have multiple breaks.
 
run the inner loops in a try accept looking for a custom "stop looping" exception
 
user2260218
8:38 PM
oooh
 
user2260218
Snazzy.
 
DSM
Custom exceptions are one method; pulling out the loop logic into a subfunction and using return is another.
 
fine, do it the boring way ;)
but seriously, do it dsm's way
 
DSM
Story of my life. (Seriously, a total stranger came up to me on the subway a few weeks ago and objected that my strawberry banana smoothie was too "neutral". A total stranger.)
 
"too neutral"? What does that even mean!?
 
8:42 PM
it needed glitter and sprinkles
maybe one of those light up cups
 
DSM
I think the implication was that I was looking to avoid notice. If that was my goal, I obviously failed completely.
 
What is even an answer to whatever that statement is? "Actually, it has genocidal intents and promotes behading - it just looks this way to deceive fools?"
or maybe: "Yes - it's from Switzerland"
 
DSM
Ooh, "it's from Switzerland" would have been good. I do deadpan pretty well.
 
user2260218
Thanks all.
 
well... I'll prepare the time machine... if future me already hasn't or something...
 
8:51 PM
Although not finished.
 
Why even use lambdas there?
 
Because I didn't want to sequence a whole bunch of ifs together.
Although now that sounds really dumb - it's the same amount of writing.
And lines.
 
you don't need the ternary return either
 
DSM
True if (something-which-returns-a-bool) else False is just something-which-returns-a-bool.
 
you can just return all((tree1(), tree2(), tree3()))
 
DSM
8:54 PM
I.e. True if x > 2 else False is simply x > 2.
(If x is an int or float, anyway.)
 
So 1) Hack off the True if... else False parts and 2) do the return all() thing?
 
@davidism or just all(tree() for tree in (tree1, tree2, tree3)) to short-circuit
 
yeah, even better
 
I would have the function return True by default, then negate the logic to return False in the ifs personally
go for the "they're compatible unless they're not" approach
 
DSM
Sounds too optimistic. Assuming people aren't compatible is probably safer..
 
8:58 PM
@DSM indeed but it'd still work in the existing logic
but naturally short circuits
 
rhubarb all, thanks for your help!
 
DSM
Rhubarb for you.
 
@DSM Have a good day!
Oh, and I meant *Rhubarb! ;)
 
DSM
9:26 PM
Time to escape! I leave my remaining rhubarb to the sopython community, to be distributed to those who need it as Jon sees fit.
 
lol rbrb @dsm
 
@AnttiHaapala: There is this guide which is pretty comprehensive.
And the documentation has a example scenario covering multi-adapters too.
 
10:01 PM
is there a known location for the unittests cpython (or pypy) use for the builtins and stdlib?
specifically looking at enumerate, zip, and itertools
can't seem to find it in either repo, or I'm looking right at it and missing it
 
05:00 - 20:0020:00 - 23:00

« first day (1466 days earlier)      last day (3487 days later) »