« first day (3555 days earlier)      last day (1618 days later) » 
00:00 - 15:0015:00 - 22:00

15:00
@roganjosh I agree that including the Tom Bombadil stuff wouldn't have suited the pace of the movie. And would have been a bit perplexing to people not familiar with the books.
Even from the books, we don't know anything about Tom Bombadil. How could you translate that to film?
@toonarmycaptain ugh
@PM2Ring I don't mind the former... Tom was at best a vivid trip after the guys accidentally ate some magic mushrooms
I'm also...very ambivalent... about Legolas doing a kickflip and grinding down stairs on a shield while loosing arrows...it didn't really fit. But it was excellent.
@roganjosh plus people are still debating what his role is and what he is and what he could have done with the ring... I don't imagine movie audiences to be able to cope with the dude putting on the ring
I'm just learning about logging in python with the import logging and I was wondering whether there is a way to set exc_info=true on a logger object level or handler level, i.e. not to be in need to pass it every time to the log function, I want to set it for the logger (or handler) so that any time it logs it has exc_info=True
15:03
@AndrasDeak just get the eagles to fly to Mordor and be done with it
@AndrasDeak did you watch any of the special features in the extended edition dvds? There's a lot of discussion about some of those decisions in there.
@MuhamedCicak Sorry, but this is now the LotR room. We no longer do python talk (I'm just kidding)
@AndrasDeak I suppose he is a bit of an upper-class twit. The same as Bilbo. But their journeys expand their mental horizons.
@Aran-Fey haha I was almost thinking that for real seeing all this LOTR talk xD
Apologies. I have read your question but I'm not great with logging so I think someone else will pick it up
15:05
@Aran-Fey We can still do python, but you have to frodo the bilbo rather than foo the bar
@AndrasDeak lol
@roganjosh Hopefully, thanks for the effort anyways!
@MuhamedCicak After a glance at how exc_info works, it should suffice to subclass Logger and modify its makeRecord method to always assume exc_info.
Reading the question isn't much effort :) We might be talking about LOTR but your question will have been noticed. It's just that I'm probably not the person to help you
has anyone worked with Neo4j in python flask?, there is good support for Neo4j in Springdata, what prevents us from having it in flask?
Want to know your opinions?
@anon-sAI what's the issue?
15:10
@toonarmycaptain nah, just the vanilla movies, once
@PM2Ring Bilbo's a troll
(not in the Middle-Earth sense :D)
When I in the past have used SpringData with Neo4j it is very easy to insert nodes and query the DB, but python has not that good support
I am looking for ways through which we can have a Spring like system in place for Python? since its definite that Python is becoming more mainstream not just in AI and ML @roganjosh
yo guys, I have a problem with a function and I can't understand why. I have a minimum version of the problem, if anybody can lend me a helping hand.
too big? formatting was not right?
@PedroSpinola Too big :) There's no exact limit but if we have to scroll to see the whole function it's typically too much. Please post it in a pastebin or similar, and link it here.
15:13
@AndrasDeak I don't remember the original films, I've seen the extended editions too many times, lol. There's quite a bit of material about the process and decision making in the adaption process, both in story/text -> script, and in the practicalities involved with sets/costumes/effects.
What does the room think of the upcoming Amazon 2nd age series?
@PedroSpinola And it would be nice if you used 4 spaces for indentation.
No amount of rational explanation can make me like those movies
and guys since its weekend I am an undergrad looking for python project ideas to kill me weekend time
You guys have any ideas or leads?
@PM2Ring what am I using? I thought it was 4 spaces, but I had some problem with that for the first time today tbh
Where'd I put that recipe for an infinitely recursive defaultdict...
15:15
I explain the problem on the pastebin itself
@Kevin a = lambda: defaultdict(a) ?
Could be ;-)
@PedroSpinola It looked like 8 to me.
I pasted with 4's though :P
@PedroSpinola But the pastebin looks fine.
15:17
@PedroSpinola Consider that lines such as t[lis[0]][lis[1]][lis[2]] = lis[-1] do not make debugging easy for people unfamiliar with your code. Several of them, well...
I should create aliases for each list element instead @MisterMiyagi ?
In any case a recursive defaultdict may be helpful to @Pedro if I understand what they're trying to accomplish
from collections import defaultdict
deepdict = lambda: defaultdict(deepdict)
d = deepdict()
stage = "pre"
value = 0.3
d["treatment"]["subtreatment"][stage] = value
print(d)
#defaultdict(<function <lambda> at 0x00262AD8>, {'treatment': defaultdict(<function <lambda> at 0x00262AD8>, {'subtreatment': defaultdict(<function <lambda> at 0x00262AD8>, {'pre': 0.3})})})
Guys which python one or two -liners gave you PYGASM (Python + Orga*m)?
I'm gonna go ahead and say that a defaultdict will probably make it easier to create the data, but will also make it harder to correctly work with the data later
@anon-sAI I'm not familiar with the library. Does the frontend issue queries to the backend?
15:20
t = {}
t['user'] = 'Pedro'
#this is ok

t['username']['firstname'] = 'Pedro'
#this returns KeyError if t['username'] was created before
@roganjosh Do you mean Spring or Neo4j?
this is why I created that function
Ok, and if you make t a deepdict instead, you won't get an error
@anon-sAI either/both
Recursion does seem adequate here, though I'd use it on the function, not the dict.
15:22
Me too, if only because I dislike the printed representation of defaultdicts.
It looks like the function would be better defined as def register(registry, treatments: List[str], value: float):, though.
I don't really understand your code for now @Kevin, will need to understand defaultdict and lambda and then take a look at it and
@PedroSpinola Apologies. I had more connection issues. I moved the message and couldn't then get my message through on why. I just saw a gigantic block of confusing code
Either way, I don't see how the function can insert a value of [0.3] when the input is 0.3. It never creates a list.
@MisterMiyagi I never register a list of treatments, instead it's only an individual one. but the thing is the number of parameters is variable from 3 to 7 (as you can see on lSize)
@roganjosh if only you saw the real code instead, you would ban me lol - I tried my best to make it readable for ya :(
15:26
Unfortunately the code is not a very good MCVE if it says "this creates output ABC, which is correct, but when I call it with something else, it produces the wrong thing"
@PedroSpinola registry would be your t, treatments would be your ['treatment','subtreatment', stage], and value would be 0.3.
@roganjosh Spring is a very vast ecosystem with support mainly targeted to Java (like Batch(for batch processing) , boot( similar to Flask) and there is a spring data concept where the spring app makes it very easy to connect to a DB, since Neo4j is nothing but a graph database , there is inbuilt support for it in Spring

Although we have py2neo in python it isnt as robust as Spring ecosystem

What I suggest or maybe discuss here is more on what prevents us from having a spring like ecosystem for Python mainly with Springdata like support for multiple databases which makes CRUD ops very eas
@PedroSpinola It's anything but readable :/ You're gonna hate yourself in 6 months, let alone any other user
@PedroSpinola Fair enough. defaultdict isn't too hard to understand with simple cases, like defaultdict(list). Kevin threw you in at the deep end there. His code creates a recursive dictionary of dictionaries of dictionaries....
def register(registry: dict, treatment: list, value: float):
    for name in treatment[:-1]:
        registry = registry.setdefault(name, {})
    registry[treatment[-1]] = value
Probably better than recursion...
15:29
Jan 9 '18 at 18:44, by Wayne Werner
@AndrasDeak It's amazing how often the person in, "Always code as if the person maintaining your code is a homicidal psychopath who knows where you live" turns out to be future you.
Thanks a lot fellas! I will take a look at all the perspectives you presented me within the next few hours, after lunch, and I'll come back. Appreciate!
@anon-sAI interesting. I don't believe there is an equivalent framework in Python
I probably wouldn't use deepdict in production code because writing a lambda that refers to an unbound name gives me the willies
@anon-sAI you can certainly plot things, and show them in Flask. I'm not aware of DB linkages that are just geared to plotting, though
I endorse MisterMiyagi's register function as a sensible approach
15:32
@anon-sAI Honestly, I think in the Python world that ecosystem is just called "Python".
I also agree with Aran-Fey that creating nested data structures like this is a source of potential headaches
@MisterMiyagi I agree but if you look at production level dev, these tools such as gradle, maven , spring really stand out
Great
And I wanted to share with you a new thing which I found out last month https://www.prefect.io/
I see lot of potential in this , what u guys think?
@anon-sAI Sorry, that's just buzzy buzzwords to me. Piling on frameworks has rarely simplified my DevOps responsibilities. What potential do you see, practically?
15:34
Doesn't really translate to Python though, does it?
@roganjosh the prefect one?
@anon-sAI I'm losing patience with you btw. It doesn't seem that you want to give us any practical thing to help with, just extol the virtues of other frameworks
user13894237
who tf banned me
@Kevin The ugly repr is one reason I tend to avoid defaultdict too. If it's a flat defaultdict it's easy enough to make a plain dict from it, but not so easy when it's recursive. ;) The other reason I avoid them is that I like the setdefault method, although a lot of people complain it's less readable than code using defaultdict.
@questionboi Nobody in this room has the power to ban anybody.
15:37
@roganjosh i just wanted to get your guys view on everything python?
I just found this room out and thats the reason why I am bombarding all the questions i wanted to ask or get views from the past few months here
By the way just completed my undergrad and want to do something big in python land
thats the reason why I maybe wanted to get your guys views on multiple things , my bad all of this came at once ,
I APOLOGIZE
Can you try and do that with more concrete questions?
@anon-sAI Right, enough of this. The first thing you need to learn is how to interact with others. Those CAPS are enough for me.
@anon-sAI We have years of archived transcripts containing tons of valuable information. And nonsense. :) Feel free to browse & search them.
My advice to enthusiastic newcomers is to hang out and get a feel for the room culture. Observe which kinds of questions get the most productive responses, that kind of thing
Which is not to say you can't ask questions without X hours of lurking. Just don't open the floodgate ;-)
^ that. Please explain what you want to do, @anon-sAI. I frequently plot data using Flask
16:00
Thank you :)
Hmm, I probably should not have scheduled two Very Important Meetings for the exact same time next week
I could reschedule and lose a small amount of face, or... I could concoct a hijink
@Kevin I almost forgot about this. :) If you xor the salt to the hash it doesn't stop DoS collision attacks. If hash(a) == hash(b) then hash(a) ^ salt == hash(b) ^ salt
@Kevin Cue a montage of Kevin switching back and forth between meetings, blaming signal loss and sunspot activity. Laugh track ensues.
The "two dates to prom" maneuver is much easier when videoconferencing. I might wear a suit in one meeting and pajamas in the other just to make it challenging
@PM2Ring Hmm, makes sense.
So the salt has to be injected early into the hash algorithm. Usually, it's an initialisation vector.
16:11
You reminded me of the tangentially related follow up question I forgot to pose: is it possible to determine Python's hash secret without ctypes trickery?
@AndrasDeak I was amazed to learn (a few months ago) that most of the canned laughter on American TV shows from the late 50s to early 80s came from a small family company. en.wikipedia.org/wiki/Laugh_track "This was invented by American sound engineer Charles "Charley" Douglass." Charley was very protective of his technology.
I tried poking through the source to see if it's exposed anywhere, but I was frustrated by a discrepancy between the code and the PEP. "_Py_HashSecret_t is initialized in Python/random.c:_PyRandom_Init() exactly once at startup" does not appear to be true for Python 3. Python/ has no such file random.c
I wonder if PEPs ever get updates to fix statements that stopped being true, or if they remain as they are for historical purposes
Hi everyone
@Kevin Although if you supply a PYTHONHASHSEED in the environment, that's easy to obtain. :) docs.python.org/3/using/cmdline.html#envvar-PYTHONHASHSEED
16:17
Does anyone know why I am getting 'Access denied' when I am trying to access a webpage using scrapy shell ?
When I just normally search in a browser , it opens without any problems
The user agent string is a common reason for websites rejecting access to bots
@Kevin I think they're frozen, like RFCs. They get superseded by new PEPs
@Kevin PEP-8 and that typing PEP PEP-484 get updated.
@MisterMiyagi Ok, that makes sense.
We need it for scrapy too? @ Kevin
If yes, can you direct me to a resource where I can look for further information?
16:19
@RaphX google "what's my user agent" and you'll get a usable answer
Cool, thanks @MattDMo and @Kevin
anyone could help me with a django problem? posted it an hour ago but got no answer and i cant advance in the project
I guess if you've got a zillion years, you can derive the hash secret by iterating through all possible secret values and seeing which one matches up with the hashes that Python gives you. But I'm not completely sure that you can eliminate false positives in finite time.
@Carlos this one? I'm looking at it now
16:29
@Carlos Please see the room rules on asking about fresh SO questions. We generally ask not to re-post questions here to avoid duplicate discussion.
Also, consider that if you quickly need help, making your question easier to answer – e.g. by providing a stacktrace instead of requiring everyone to reproduce it – is in your own interest.
@MattDMo As much as I like to defend Australia's fauna, I have to admit that King Brown snakes scare me. I saw a juvenile one a couple of years ago, on my parents' lawn, less than 2 metres away from Dad & me. Dad carefully walked away & returned with a long-handled shovel, with a sharp blade, and snuck behind the snake, which was still looking in my direction.
Yikes
@PM2Ring it says a lot about Australia's fauna that I keep seeing Australians say "Huntsman spiders? Nah, those are cute little critters"
I've had encounters with coral snakes and water moccasins here in the NE US, and that's plenty for me. I don't mind snakes in general - my kids and I go searching for garter and black snakes all the time - I just don't like venomous or poisonous things. Australia just seems to be chock full of them.
Luckily, Dad still has very good aim. And he's been using axes, etc, since he was a kid. King Brown's are a protected species, but in a situation like that... The official advice is to not try to kill dangerous snakes, because so many people who attempt it fail, and that tends to make the snake extremely angry.
16:45
I'm so glad that no homicidal animals live in the Pannonian Basin
@AndrasDeak They're large, but fairly timid. They only try to bite you if they're cornered & fearing for their life. But I'm sure I've spoken about them here before.
@AndrasDeak But don't you have vampires?
My reaction when a rude human tries to cut off my head
Most of the snakes I've encountered in Australia are constrictors, various Python species. I've only seen 2 venomous ones in the wild.
"Pythons? Yeah, I've encountered 2 or 3"
16:49
Is there a way to see how quickly votes were made on a question? I have no idea why this one has three upvotes.
@Kevin Wait, how often does this happen to you?
I can't think of any scary animals in NJ other than rabid bats and raccoons, but even those I've never seen personally
@MisterMiyagi Basically whenever a destined hero hears the call to adventure and crosses the threshold into my lair
@MisterMiyagi I don't think so. There's a daily vote summary in the timeline
So like, once every 20 years or so? You usually don't get more than one destined hero per generation, since it's embarrassing when they show up to the same trial
"I've only got enough golden fleece to bestow upon one of you, so... Rock paper scissors?"
It's pretty hard to see most of Australia's critters up close in the wild. They tend to run (or hop) away pretty quickly.
Most animals are probably better off being afraid of humans
If only so they don't have to get tranquilized once a week when they wander into town looking for tasty garbage bins
17:00
needs details (and attracts lots of bad answers) stackoverflow.com/questions/62838750/…
OTOH, possums can be a bit of a pest. They like living in roof spaces, especially during the cold months. They aren't aggressive, and they are very cute. But they aren't toilet trained. ;)
@MisterMiyagi closed
The one animal that Australia has that isn't the scariest variant
My parents had possums in the roof for a while. When we were sitting on the side verandah, a possum would often poke its head out and see what we were doing.
@MattDMo yeah...though not domestically as of 100 years ago :)
Vampires are hard to detect these days because mirrors aren't backed in silver any more, and nighttime hunts for blood have been superseded by discreet craigslist ads for people who are into that sort of thing
17:10
One evening, it made its way into the lounge room. We tried to shoo it outside, but it had other plans. :) I tried to block off access to the hallway, but it ran straight between my legs. They're very solid little things, with very tough skulls. He almost bowled me over.
@AndrasDeak :) Yeah, Transylvania is now in Romania, not Hungary.
17:23
Is there an expected contract of __eq__() and __str__() that if a == b then str(a) == str(b)? Is this contract explicit or codified anywhere?
I don't think that's expected, no. Consider that 1 == 1.0, despite having different strs.
hmm
so if a custom __str__() of a class outputs a numeric field, then we already break this...
assuming __eq__() also compares that numeric field
@MisterMiyagi Since I am quite a beginner in Python, I don't really know how that'd look like. I need to create my own class, and then inherit Logger class, and do I just override the function having the same parameters except setting exc_info to default true? How do I do all that in Python?
I usually think of __str__ as being for the benefit of the human rather than the computer
So you can generally do whatever you want with it
i am looking for a tool which i can use to do some connectivity visualization, that i am able to update using structured data like json.
Goal is to have a zoomable world map that shows connectivity across the world.
What should i google for this, or maybe if you know something i should try
17:30
@Kevin yah, I often use str() to format output that will be displayed to the user. Most of the time this output will be the same for to equal objects, but I can see how there can be exceptions.
The only contract I'm aware of that's tied to __eq__ is if you're also implementing __hash__: "objects [instantiated from the class you're defining] which compare equal have the same hash value"
If there are any other contracts of that nature concerning dunders, they're probably on that page
18:16
@PM2Ring How do you access the timeline of a question, other than entering the URL manually? I've never seen a link for it before.
@MattDMo as of a few weeks ago there's a timeline link (clock icon) under the downvote button
before that it was only accessible via URL hackery (or equivalent userscripts)
Oh, that's what that is for. Thx
And (of course) the timeline icon isn't visible in the Mobile view, you have to use the Full site.
I try to stay off SO on my phone, otherwise I'd probably never leave
Wise
18:23
@MattDMo but... Hotel California and all that :)
@MuhamedCicak Hm, that needs some explaining to go into detail, more than I currently have time for. Basically you need to define a class MyLogger(logging.logger):. This must have a makeRecord method that always calls super(). makeRecord, forwarding all arguments but setting exc_info=True. You then have to mount this using logging.setLogger.
That's the gist. Try to work through this step-by-step. People here should be able to help you along the way, even when I'm not online.
Norah Jones has been posting lots of stuff from home during quarantine, mostly piano + vocal, sometimes playing guitar. But she just released a pop / Goth song Flame Twin a few days ago, and it's already hit 47k views. I wonder what her Country fans think of it...
18:42
Norah Jones isn't a name I've heard in a while
Mind you... being an Elton John fan, I do like Sara Bareilles' take on Goodbye Yellow Brick Road
(and that wasn't a name I'd heard in a while either...)
Country and goth are just blues except with a cowboy hat and black fingernail polish respectively.
"My wife left and took the dog and truck" and "the universe is an uncaring void" fundamentally refer to the same idea
@JonClements Sara B is pretty impressive. Brandi Carlile does an interesting version of Madman Across The Water. It's not a strict cover, but I think Elton would approve.
@Kevin Yeah, I guess so. :)
ooo, I like her voice...
She has a lot of power in that voice.
Not sure it's someone I've heard of before - is she someone you've linked me to before?
18:56
@JonClements I don't think so.
phew - my memory isn't too much worse these days then :p
For a change of pace, here are a bunch of guys from New York, doing a groovy Simon & Garfunkel song, Baby Driver
I quite like that... it's a fun song anyway
19:21
Haven't listened to any Gordon Lightfoot recently (youtube.com/watch?v=fT_J-LNqVvw). Mind you - the version Johnny Cash did on his last American V album (youtube.com/watch?v=xEx147n9G1A) - I think was in someway better, the more gravelly voice and him not being about for much longer and all that... hits home a bit more I think.
Here's another one from Josh & Carson, this time with a couple of young ladies. An old Gerry Rafferty number I'm sure you know. youtu.be/1T3B502Ut94 These guys did a UK tour, late last year, playing originals as well as covers.
my neighbour is having a karaoke... somehow, karaoke isn't quite as amusing when you've not had a few pints and shots :p
completely butchering a Nolan Sisters track right now...
@JonClements Yeah. I've heard the original a zillion times, I remember when it was in the charts. Johnny's gravelly voice somehow makes it feel so genuine.
@PM2Ring yeah... and the NiN cover he did of "Hurt" - really worked for the same reasons (I think).
19:37
@JonClements Oh. Karaoke: from the Japanese words for "tone-deaf" & "drunk". ;)
@JonClements Definitely. He takes it into a whole extra dimension.
@PM2Ring murdering Summer of '69 now... sighs
@PM2Ring Think the video was also well done and helps it along... but yeah, it's definitely a poignant version
I usually listen to all the links during Music Chat in the hopes that it will expand my horizons but I usually end up thinking "this would make a good nightcore track" so I don't think it's working
For some reason at the back of my mind though - NiN - something about the original version of Quake?
I'll keep trying though
Quake is the soundtrack album to the 1996 id Software video game of the same name, composed by American industrial rock band Nine Inch Nails. Originally pressed on the same disc as the game, Quake has yet to see independent release, though a vinyl version is planned. Trent Reznor, the sole member of Nine Inch Nails at the time, also provided sound effects for the game. == Background == The collaboration between Nine Inch Nails and id Software occurred strictly due to a mutual admiration for each other's work; Reznor provided his services to Quake completely free of charge. == Composition and... ==
19:44
The only band/classic shooter factoid that I know is that Doom's cheat code idspispopd is an abbreviation for, in part, "Smashing Pumpkins Into Small Piles Of Putrid Debris" and the band Smashing Pumpkins makes reference to Doom in one of their albums
ahh... there we go - I'm not imagining things
@Kevin never heard of that code
Apparently Where Boys Fear To Tread samples some Doom sounds.
Here's a funky, up-tempo song about depression. ;) All That You Dream, Little Feat, with Linda Ronstadt.
think there's a rap artist track that also samples a bit from Resident Evil... the "you're all going to die down here" bit...
is it Timberland?
ahh yep... a track called "Kill Yourself" - and reading the lyrics - omg
Oh... it's "Timbaland" - not "Timberland"...
19:53
@MisterMiyagi Thanks, currently I am just passing it manually everytime but surely I will need this in future when it gets ridiculously repetitive, thanks for the help. If I encounter any problems along the way of implementing it, I will write here, as you said, I'm sure there'll be someone to help.
That title reminds me of Skrillex's Kill Everybody
Here's a brother & sister duo doing a cover of an old uplifting cosmic song Dream Weaver. They're both multi-instrumentalists, and write good original songs too. They often perform individually, but I love how their voices work together.
@Kevin arhgghgh... that's so very nightclub and "gone to powder your nose" music :p
@JonClements Skrillex...so probably "wub wub wub NYEEEEHHH wub wub wub"
"Kill yourself" is also the title of a darkly humorous song by comedian Bo Burnham. Catchy but I feel deeply awkward googling it
@AndrasDeak How did you know :-o
The song just got to the wub part as I read your message.
19:58
@AndrasDeak think that sums up the genre, yeah :p They can stop doing it now you've one-lined it :p
@JonClements obligatory "drop the bass" gif i.imgur.com/6dqeI.gif
Skrillex makes a good soundtrack for dismembering refactoring code. I also like the Doom soundtrack. Rip and Tear those bugs.
so... late dinner... and seeing what's new on netflix... "The Old Guard" looks like it might be alright, but there's also "K-9" which I haven't seen in a while... wonder if they've got "Turner & Hooch"
Another one from Sierra, on keyboards, covering Joni's The River
@PM2Ring Sierra just made me think of Boz Scaggs
(that's quite a nice track)
20:04
@JonClements Ok. I'll have to think about that. One of my favourites by Boz is an old blues "Loan Me a Dime", with Duane Allman on guitar.
will try and look that up - anyway... settled on k-9 I think... see how it goes
hopefully the karaoke won't be lasting too much longer :p
@JonClements Many attempt to cover Joni Mitchell, but few can do her songs justice. I think Sierra has the emotional sensitivity to do it. Another woman who can is Aoife O'Donavan. Let me find a good example..
I can't resist posting another one. Canada's alternate national anthem, A Case of You. Recorded at the same session, celebrating Joni's birthday.
bookmarked and will have a goosey later - thanks
No worries.
Shelter has some nice synthy elements, and no wubs nor bass drops
20:22
in SO Close Vote Reviewers, 11 mins ago, by ForceBru
Hello everyone! Some question was just closed as a dupe of this one (https://stackoverflow.com/questions/17375793/or-conditional-in-python-troubles), which is itself a dupe of this one (https://stackoverflow.com/questions/15112125/how-to-test-multiple-variables-against-a-value).

Now, I don't think the 2nd question is actually a dupe of the last one. The last one has syntax like `x or y or z == 0`, but the second one - like `x == "monkey" or "monkeys"`, so the `or` is on a different side of the equality operator. I think these questions are very different because `x or y or z == 0` is the s
(I've said to pop along here if they want - so just a heads up)
"it's a long way forward // so trust in me // i'll give them shelter like you've done for me" is a nice message of perseverance and kindness for our tumultuous year
@Kevin It's sweet, but a little bit too electronic & auto-tuned for my tastes. Here's another song with the Shelter theme. Gimme Shelter, played by the young ladies from the School of Rock, with special guest Aussie guitarist Orianthi.
20:37
♫♪ d(-_-)b . o O {Hatsune Miku could do a good cover of this I bet}
And now for something completely different. Band Geeks, covering Heart of the Sunrise, by Yes.
I didn't realize there were versions of Shelter without the animation. Is that even legal?!
Yeah, I've reopened this, but it actually boils out to the same expression as the condition. So x or y or z == 5 is (x) or (y) or (z == 5), which evaluates to the first if the parenthesised expressions that is truthy. And x == 1 or 2 or 3 is (x == 1) or (2) or (3), which again evaluates to the first parenthesised expression for which bool(...) is True
So the intent is different
But for Python it's all the same
I can't watch the animation, it makes me too sad
Now I'm not sure if it should be reopened, since Python sees them as the same...
20:45
@ForceBru do you mean intent of a good programmer or intent of the asker/reader?
Yeah, as @DavidBuck said. The same for Python, but different intent of the OP
I mean the OP's intent
In my experience, there are much more questions involving thing == a or b or c or d
I think of all those kinds of antipatterns as the same, which is why for a long time I hammered most posts along those lines as a dupe of my Q/A, Why does a == b or c or d always evaluate to True?. But occasionally people would debate about whether it's an exact dupe of whatever question, so there must be a fair population of people that don't agree with me
These days I just stay out of it and let everyone else sort things out :^)
They all come down to the same basic misunderstanding about how if statements are evaluated, tho.
@ForceBru The intent may be different, but part of the learning journey of Python is understanding why it's really the same thing in Python. And a good answer ought to cover that.
@Kevin, yes! This is the perfect dupe target for this type of questions! I'll need to start a list of potential dupe targets soon. To VTC more quickly
20:49
There's also one answered by Martijn Pieters which is good. Oh, it was already linked in Meta.
@ForceBru FYI we have a canon
not perfect, but it can be useful for certain dupes
The canon actually lists 3 questions for this topic: sopython.com/canon/22/…
BTW, here (sopython.com/canon/22/…) the link called "How do I test one variable against multiple values?" leads to a question called "How to test multiple variables against a value?"
@ForceBru sounds the same to me
Dupes can guide askers to their fundamental problem
Yeah, maybe I'm overthinking this actually
20:55
The variables / values distinction isn't that much of a distinction in Python. We don't have variables like other languages. We have objects, that have values, and those objects may have 1 or more names, or no name.
Jun 20 at 10:43, by PM 2Ring
@CodyGray Python objects are strongly typed. But people say that Python isn't strongly typed because of the way our datamodel works. See Other languages have variables; Python has names. Sorry, the original site vanished, so that's a Wayback Machine link.
Yeah, I think I first saw it explained on this exact site, with these exact images
@AndrasDeak Indeed. But for this particular issue, I think it's a good idea to provide a couple of dupes, and if necessary, a short comment to help guide the OP.
So cool that this site with common questions exists! I was always trying to close these if x == a or b or c or d questions, but could never find a suitable dupe target. Now oh boy, am I gonna slap an actually helpful dupe target on such questions!
@PM2Ring multiple targets, yes. Reopen, no :)
I'm not too worried if someone wants to write a new answer that's specific to the OP's code, if the OP is having trouble relating to the dupes. OTOH, we definitely don't want a new answer from someone who doesn't really understand what's going on, who is just going to add to the OP's misunderstanding & confusion.
@AndrasDeak Yeah. It shouldn't be necessary to reopen. But it's not a calamity if a good answer gets posted before the question is dupe hammered.
21:09
Well...I'm not crazy about umpteenth dupes getting any kind of answers, good or not. These already have a plethora of good answers elsewhere.
In my rebellious days sometimes I would answer a question and then answer it
@Kevin Hmm? :)
Did you misspeak or am I missing something badly?
Maybe he meant answer & then hammer.
Oops, yeah
or ask and then answer
your version would make a lot more sense, though
21:12
For example an OP might ask "why doesn't a is b or c or d do the needful?" and I'd say "try a is b or a is c or a is d instead. See [link] for an explanation of why comparison operators don't commute across or"
If I just hammer, then the dimmer OPs would be like "I don't see how this answer applies, I'm using is, not ==". If I just answer, they learn what the correct syntax is, but not why.
Answer as in answer or answer as in comments? There's probably a huge difference here.
I answered in an answer because between my two principles of "don't leave the OP with half an explanation" and "don't answer the question in a comment", I considered the first one more important
Eventually I flipped polarity and clarify in a comment if the hammering needs context
@Kevin that doesn't make sense as a justification. As written, we should have had no problem compromising the latter principle for the sake of the former.
What we probably meant was: between my principles of "don't leave the OP with half an explanation" and "don't answer the question in a comment", and "don't use your hammer in scenarios that present a conflict of interest", I considered the last one least important
21:30
It's good to help & teach OPs. And it's also good to encourage OPs to ask good quality questions, and to help them polish the question when it's not quite up to the standards we'd like. In the spirit of the Sand & Pearls philosophy, it's hard to write good answers to bad questions.
For many users of the network, the question is merely an extended title: they're here to read answers not questions. The question just helps them to find the appropriate answers, and to determine how applicable the answers are to their problem. In fact, some people don't even bother giving the question more than a brief glance, if that.
00:00 - 15:0015:00 - 22:00

« first day (3555 days earlier)      last day (1618 days later) »