« first day (2190 days earlier)      last day (2761 days later) » 

12:19 PM
@holdenweb Thanks. I hadn't read that paper before, but I'm pretty sure I read a summary of it not so long ago. The theory (that some people just don't get programming because they don't use the right kind of mental models) makes sense to me.
Various techniques that have worked for millennia just aren't applicable to computers: you can't communicate sloppily and hope that the computer is smart enough to figure out what you mean; you can't treat a computer like a slave or beast of burden and force it to do your bidding with threats or actual violence. ;)
 
@AnttiHaapala we say "for ciklus", close enough
also recbg
 
@poke Then apologies, we go through a metric tonne of flags a day and statistically I am guaranteed to make mistakes. Do feel free to flag comments you feel are unconstructive (like theirs was).
 
@Martijn No worries, I was mostly curious/confused about that situation. And as I said above, I wanted to clear the fire first.
 
@MartijnPieters you make mistakes!? OMG Tony the Pony he comes!!!!1111
 
@Jon Those who actually do work tend to do mistakes eventually........
*snark*
 
12:30 PM
@poke wish some mods admitted their mistakes on meta, right?
 
I was hinting at Jon not doing his job as a mod xD
 
I know:P
I was hinting at this
 
@poke awww... is it pick on Jon day? :p
 
There should be a video of that, in the style of the "MongoDB is Web scale" video.
 
12:32 PM
@JonClements Hi sir
 
@AndrasDeak you do?!
 
can you help me
 
that's strange :D
 
@JonClements <3
 
user559633
@Sami Don't ping random users. Read these room rules before continuing: sopython.com/chatroom
 
12:33 PM
@AnttiHaapala well foreign loan words are common in STEM, we don't even have a word of our own for file
 
@poke Martijn and I have slightly approaches to what we moderate is all :)
 
@AndrasDeak why not hurok
 
@AnttiHaapala because bleh:D
 
different thing for gods sake!!!
 
@AnttiHaapala different from what?
 
12:33 PM
loop is a thread that is made to go around, and continues on the other side
has about 0 in common with a circle...
 
circle is "kör", "ciklus" is Latin>Hungarian for cycle
 
ah :D read wrong initially
saw an r there :P
 
just like a parliamentary cycle
 
@Sami I'm going to guess what you're going to ask and no - we've talked about it before - we're not going to remove your restriction to create new rooms.
 
@AnttiHaapala OK:P
 
12:35 PM
but anyhow,
 
@JonClements is that a 500rep privilege?
 
@AndrasDeak guess you Hungarians are silly not unlike many Finns
"loanwords are good, Finnish words are bad, they sound so stupid"
 
possible
 
@AndrasDeak nope - you can create new rooms at 100 which is the required rep to be an RO
 
@AnttiHaapala in STEM they really do
@JonClements oooh, interesting:) Thanks
 
12:36 PM
Not the room , i flag him
 
"like... loop is so much better than silmukka, because the latter just reminds me of thread that makes an opening"
and then they don't realize that they're metaphors in the English language.
 
@AnttiHaapala I had to write a Hungarian glossary for my thesis; I was sweating blood by the time I finished
 
loop is what the thread does when you make a closed knot...
everything else is a metaphor
 
@AnttiHaapala yeah, actually "hurok" which is a good translation for loop, is primarily associated with a noose. Now you wouldn't call a loop a noose, would you?
 
someone looping around, a loop in road...
well, idk again :P
in Finnish the hangman makes hirttosilmukka, hanging loop so
:D
 
12:38 PM
ciklus, just like the parliamentary one, conveys the meaning of repetition around a closed path
 
but loop makes it clear that the thread continues on the both sides...
 
hurok is for strangling people, or snaring wild animals:D
@AnttiHaapala I really don't think that's even implied in English
 
it is
 
aren't you imagining too many things into that word?:P
 
12:40 PM
I really can't tell, my knowledge of lops might pre-date my knowledge of the word loop?
 
     1. A fold or doubling of a thread, cord, rope, etc., through
        which another thread, cord, etc., can be passed, or which
        a hook can be hooked into; an eye, as of metal; a staple;
        a noose; a bight.
        [1913 Webster]

              That the probation bear no hinge, nor loop
              To hang a doubt on.                   --Shak.
        [1913 Webster]
 
I meant into the computational meaning
I know what a loop is, but I never thought the threading bit to be relevant to the programming context
 
it is better metaphor than circle, because the thread continues on the both sides
thread is metaphor too
 
yeah, and a circle doesn't have a sense of time, it's static
 
___O_________O__________O______________O______
 
12:41 PM
I'm OK with ciklus
 
ciklus doesn't break
 
yeah it does, that's what revolutions are for
 
except if Orban changes the constitution
:D
 
some translations of loop in an online dictionary mean "knot" *facepalm*
 
In order to ensure our security and continuing stability, the Republic of Hungary will be reorganized into the first Orbanian Empire for a safe and secure society.
 
12:44 PM
it's partly crowdsourced, so it's just wrong
@AnttiHaapala you think you're joking
 
@AndrasDeak could mean that too
@AndrasDeak I don't :D
 
that makes it darker, doesn't it :D
 
good one:D
typo already answered quick quick stackoverflow.com/questions/40043589/…
OK, no answer now
 
@JonClements It's a statistical inevitability. So far, I'd like to think that the error rate is really low, given the number of complaints on Meta vs. my daily flag handling rate ;-)
 
user559633
12:54 PM
Martijn made an error? I think I'm going to go sit in an empty field today as I imagine a solar flare happened that will cause bits to flip and planes to fall from the sky.
 
The alternative is that Martijn doesn't make mistakes, in which case he was mistaken in saying he makes mistakes, and would subsequently vanish in a puff of logic.
 
user559633
You give me a sense of normalcy.
 
Ponderings: Should I answer "use a different editor" to Wim's PyCharm question?
 
user559633
If you came in and said something not clever, I'd be climbing under my desk right now.
 
@Kevin poof
 
user559633
12:56 PM
@MartijnPieters lol, if you do, then I'm going to on a question I answered last night.
 
user559633
@MartijnPieters Rude!
 
:-P
 
did Martijn just poof away Kevin?
 
user559633
No, but he called him one.
 
@tristan what in the name of all that's wonderful, is Rodeo IDE?!
 
12:57 PM
@MartijnPieters how many NAA flags do you handle ~ in comparison to other flags?
 
No he vanished paradoxically himself. But also didn't vanish at all. That's paradoxes for you.
 
user559633
@MartijnPieters "yhat" IDE for scientific computing
 
@AnttiHaapala as much as needed to keep the queue manageable. Today, about 25%.
 
user559633
It's a strange day indeed, as that question has made me want to ask a Python question
 
@MartijnPieters most of the NAA could really be avoided... :/
 
12:58 PM
 
should perhaps write a post on meta about redesigning the answer form for unregistered
 
"redisigning the answer BOOM "
 
yeah I guess so
"Stack Overflow, optimizing for sand, not pearls, since 2008"
 
user559633
My understanding of CTypes is that it would take the shared object, map it, then dispatch a thread when calling the relevant C code. Is that not the case? I quickly tried to use dtruss on OSX last night to trace the syscalls, but I'm not very familiar with that procedure on OS X and I figure that it would be more educational to ask an expert
 
@AnttiHaapala "but hey, we reworded the popup for low-rep upvoters"
"and changed that shade of green"
 
1:01 PM
sure, the sand is the reason why a pearl exists...
 
OK, credit where it's due. We also have SOD.
 
@AnttiHaapala I am pretty sure there are already such proposals there.
@AndrasDeak BOOM flagged as duplicate.
 
user559633
Related, I'd assume that a call to a ctype'd library would response with a RC if calling directly to an output stream, but that would an output stream handled by the Python interpreter. Is this wrong? I thought this would be how PyCharm knows how to show the output of a ctype called printf.
 
@MartijnPieters :D
 
Unregistered answerers must first prove their virtue by putting their hand in the Mouth of Truth and removing it unscathed
 
1:02 PM
Hey @Kevin There's a new question about making GIF anims with Pillow, if you have any suggestions. stackoverflow.com/questions/40043301/…
 
user559633
In SO Corp's defense: sand can be placed into new jobs, while pearls are typically happy where they are
 
390
Q: Introduce an "Obsolete Answer" vote

KrumiaBackground There is a meta discussion going on, on How to deal with hugely upvoted, bad answers?. And as an answer, I wrote: You can downvote, comment, and provide a better answer, of course. But... If the obsolete answer is really old, it is most probable that your comment/answer will...

nice idea
The biggest problem is that the new answer form has a link to another page that tells how to answer...
 
@PM2Ring Much like you describe in your comment, I too save individual frames and then stick them together with ImageMagick.
 
@Kevin that should cut down nicely on all the 'moderator unfairly suspended me / removed my rep / deleted my posts!' complaints.
 
user559633
[is my question interesting enough that i should do a self-answer?]
 
1:06 PM
instead it would say, for unregistered users when they start to type that Please use the answer form to answer the question, not to request clarifications, thank the other answerers, or asking another question. Such "non-answers" will be swiftly deleted.
 
@Kevin but now you ruined the magick
 
and the latter one a link to "ask question"
because no one reads instructions
such a sentence could remove 50 % of NAA's alone
 
it would take much less effort to disable unregistered answers altogether
 
@Kevin Ah, ok. I guess PIL / Pillow is ok for basic things, but I don't trust it for fancy stuff. I was underwhelmed at its ability to scale images properly, as I mentioned here a month or two ago.
 
but that's not what SO is about nowadays
 
1:08 PM
@tristan Anything involving Ctypes is probably safe from drive-by downvoters because it's too complicated to determine whether it's simple or not ;-)
 
@AndrasDeak there has been good unregistered users
 
sure, they can register:P
Only a few days ago you had to delvote an answer that was given by an unregistered, because they can't do that themselves. Great [by-design]
 
user559633
@Kevin Heh. I wasn't worried about my E-Points, more just wondering if it was actually of interest to anyone else. I think if I go grab some pretzels, I'll forget I was interested in learning how this actually works, so if the silence to the question is because "eh not that interesting", then it's probably a sign to do the work I'm supposed to be doing
 
@tristan I think your sudden burst of on-topicness is lost in between our flood of whining
 
user559633
sorry, yeah, i know it's weird for me to ask a python-related question instead of just providing the dubstep equivalent of hyperbole
 
1:11 PM
if you encountered a problem that wasn't trivial to solve by googling SO and might help others in the future, go for it
 
user559633
oookay. i'll find a way to get more than 500mb of free space on my laptop so i can make a linux virtual machine
 
:)
SSD problems?
 
user559633
yeah, macbook air, so it's only a 128gigglebyte drive
 
macbook air <3
 
I'm starting to fill up my 1TB (HDD of course)
 
1:13 PM
729
Q: Transatlantic ping faster than sending a pixel to the screen?

Konrad RudolphJohn Carmack tweeted, I can send an IP packet to Europe faster than I can send a pixel to the screen. How f’d up is that? And if this weren’t John Carmack, I’d file it under “the interwebs being silly”. But this is John Carmack. How can this be true? To avoid discussions about what exact...

 
@tristan 1TB SSD in a Macbook Pro, yeah. I couldn't live with just a MB Air.
 
@AndrasDeak read the accepted answer
 
@MartijnPieters :|
 
user559633
@AnttiHaapala yeah, it's a seriously great choice for when you're mostly moving between offices. light and the form factor means it's not in the way
 
user559633
@MartijnPieters spendy! i was going to reward myself with a new macbook pro, but it's been a year and a half since a hardware refresh
 
1:15 PM
I paid more for my thinkpad than the cheapest macbook airs are
 
@AnttiHaapala guess it would be cooler if I knew who that was
the top comment on that answer says it all:D
@AnttiHaapala ah, you mean unregistered
 
John D. Carmack (born August 20, 1970) is an American game programmer, aerospace and virtual reality engineer. He co-founded id Software. Carmack was the lead programmer of the id video games Commander Keen, Wolfenstein 3D, Doom, Quake, Rage and their sequels. Carmack is best known for his innovations in 3D graphics, such as his famous Carmack's Reverse algorithm for shadow volumes, and is also a rocketry enthusiast and the founder and lead engineer of Armadillo Aerospace. In August 2013, Carmack took the position of CTO at Oculus VR, which in 2014 became a subsidiary of Facebook. == Biography... ==
 
@tristan I just walked up to the IT desk and asked for an external drive because I had drive space issues. They then told me I couldn't have an external drive because those are harder to secure, so they'd swap my laptop with a 1TB model instead. Two weeks later I had been upgraded.
 
user559633
@AndrasDeak yeah, i have > 1gb in my windows/gaming machine, but have been making due with 128gb of "important data" for years
 
So I don't know if it was spendy...
 
1:17 PM
funny how "the lead programmer of the id video games Commander Keen, Wolfenstein 3D, Doom, Quake, Rage and their sequels." didn't bother registering
 
user559633
@MartijnPieters Do me a quick favor and say that you need a spare?
 
@tristan should feel particularly grateful :P
 
so I still refuse this as a counterargument to mandating registration
 
@AndrasDeak he just wanted to answer that question about what he said
 
@tristan I would have loved the old one as a spare. That's the downside of having such a helpful IT desk; they keep track of assets too well for one to go missing :-/
 
1:18 PM
@AnttiHaapala I can see that:)
 
You clearly need to figure out how to use Europe as a display technology. — wfaulk May 3 '12 at 14:29
 
@tristan: the alternative: come work at FB!
 
but then you need to use that 1TB SSD for evil
 
user559633
@MartijnPieters Wouldn't pass the interview -- I'm not very good with computers
 
@MartijnPieters first google, now FB dropped from my list of favourable employers :D
 
1:22 PM
afternoon cbg
hey @MartijnPieters did you know/work with Jackson in the London office before he left?
I appreciate it's a fairly big office though
 
^ Great form design, that
Wonder what happens if I check both
 
:D
 
The universe explodes
it's like dividing by zero
 
race condition, server melts
 
I've had a recruiter or two from FB contact me, but they want people on location, so there's that
 
user559633
1:30 PM
Facebook could/should acquire my company ^__^
 
user559633
scaling problem: sorted
 
the only recruiters that contacted me was by facebook for a dumb wordpress project
 
user559633
yeah, you should hold out for "regular wordpress" projects
 
I don't even know PHP
assuming you need to know PHP for wordpress stuff
 
user559633
1:33 PM
You need to know wordpress PHP, which is different from PHP.
 
user559633
It's like memorizing Django, but a little more "just trust this function alters your database state table the way you want/need"
 
You don't need to know PHP to do Wordpress. They have helpful comments:
// Start the loop.
while ( have_posts() ) : the_post();

// End the loop.
endwhile;
 
lol
professor told the students to comment every line
 
God I hate wordpress
 
user559633
// the following is a comment
// the following is a comment of a comment
 
user559633
1:36 PM
oh no
 
@tristan better than the comments I'm finding in my project
 //WARNING: SHIT CODE BELOW
 
@khajvah so it will still be better than my favourite php project
the comments are scarce resource there... but where they do exist, they're something like
 
@SterlingArcher I usually do stuff like "TODO: Fix the following shit"
and then never fix them
 
 // we increment the variable $a below by 1
 $a ++;
or...
 
@AnttiHaapala oh I nearly thought the code is good enough to not need comments
but then you continued
 
user559633
1:39 PM
I'm going to start just leaving biblical comments in my code

// "So when they continued asking him about this function, he lifted up himself, and said unto them, He that is without sin among you, let him first cast a stone at her. -- Jesus Christ (kinda)" -- tristan
 
Thankfully we installed ng-doc into our projects so it forces javadoc style documentation which is good
 
// loop over the items in $ffyy, then calculate something and frobnicate them
foreach ($ffyy as $f) {
      $f->foo += 123++ - $fda+12+3+213;
      frobnicate($f)
}
 
I only leave doc-strings and only on public methods
and also "TODO: fix this shit"
sometimes
 
one should assume that the reader can read code and comment why do we do the thing we do.
 
user559633
It worries me that grepping TODO in my application base returns 153 'TODO:' in files that I wrote and 139 in libraries I've included.
 
1:45 PM
41 in mine :D
 
Do you actually come back to fixing "todo"s?
 
The todos I leave in my workplace's code are less "I'll fix this later" and more "dear future reader. You may notice I implemented this sub-optimally. I am aware of this. Please don't think I'm dumb."
7
 
morning everyone
 
Ok I have to make a decision for tonight: should I get drunk or should I get shitfaced?
 
@Kevin in Slashdot terms, that would be +5 Insightful
@khajvah rather, port something to python 3
 
1:50 PM
sober enough to code, drunk enough to not notice you shouldn't be coding
(inb4 "ballmer peak")
 
I could also learn PHP just to make fun of it in future.
 
@Withnail Absolutely. He was the first FB engineer I met at the office, he showed me round.
Great guy!
@AnttiHaapala Pwew, close call there!
 
Sometimes I miss my PHP days. But then I look at python code and I don't anymore.
 
Hah. Meant to ask the last time FB came up. :)
 
do you guys know any book on programming language theory?
 
1:53 PM
Top guy, was helping me with engineering interviews over the summer. (As in, being interviewed)
 
@Withnail he was extremely perceptive too. Picked up that I was deaf in one ear without me saying anything about that.
@Withnail that's his thing now, has a YT channel and everything.
 
Yeah, partly why I roped him into it :D
 
Obviously of no consequence to your life, just a 'oh we know some of the same people' thing which was a gently pleasing surprise. ;)
 
2:05 PM
@MartijnPieters o/
 
Protip: make sure you're stocked up on cold medicine and chicken soup before you get sick enough that leaving the house is painful.
 
Life status update: attended board game night despite having a cold. At the end of the night when the host offered a handshake, I patted him on the back instead. Great success.
 
Are we both sick at the same time? We're supposed to be a hivemind, not a hivebody.
 
Other guests may have noticed that I washed my hands every thirty minutes, but they said nothing. I guess they just expect inexplicable weirdness from me by default
 
@SterlingArcher \o
 
2:13 PM
@KevinMGranger Yeah that's definitely not intended behavior. I'm logging a bug report with the higher-ups.
 
Well, it could just be a coincidence. But that does mean we don't have enough Kevin redundancy in here.
 
I keep a spare Kevin in a hermetically sealed vault at the bottom of a salt mine. Just in case.
 
> It's not just you! c2.com looks down from here.
 
uh oh
 
2:27 PM
@khajvah !!!
one of greatest tragedies and you'll make fun of it?
 
Does anybody know how HR picks interview candidates from bunch of applications?
 
random.choice, I reckon
 
Depends on the HR person; but usually it's either a good cover letter or a skill match
 
what if there are 1000s of appliers? Like in Google's case? I guess it's random
 
I doubt it's "random"
 
2:33 PM
@khajvah In good organisations, they don't. Or at most, they do a very initial sift based on the 'must have' criteria from the job ad.
In smaller orgs it's the hiring manager
 
DSM
Morning second cabbage.
 
Second morning cabbage? Second cabbage morning?
 
@khajvah grep
 
@Martijn pedant? :)
 
user559633
@khajvah depends on the company, but typically it's "term match in skills provided to them", years experience, length/format of resume, cursory search of candidate to verify basic information on resume
 
DSM
2:59 PM
Format matters more to me than it probably should, but I have to admit that resumes formatted in odd ways have a higher bar to jump with me than well-formatted ones. Some of that's just prejudice, of course, but some of it's rooted in the idea that if you can't sort out the implicit requirements of making a CV, you may have trouble understanding other underspecified problems of the sort that will actually occur. Again, it's not like I don't read them anyway, but there is a penalty.
 
@DSM I think if it's not at a quick glance completely unintelligible or contains spelling/grammar errors in the first paragraph - I'll read it anyway
 
DSM
@WayneWerner: "Maybe you want a LISP shop." <- guilty as charged
 
user559633
what about if it's in comic sans and printed on the back of a piece of junk mail
 
Being a head of a production/development department a long time ago, I was quite surprised HR sent me what was obviously something for the design team.
They didn't send a CV - they sent a faked up credit card
 
3:04 PM
Word docs are the worst :P
 
user559633
i used to maintain my resume as a manpage
 
So it was basically a faked up card with the company name I was working for as the logo - they'd matched the company colour scheme, put their phone number as the card number, and on the back put their web address and signature...
and the covering letter was awesome
I'm sure most people when you receive a new/replacement card from the bank, have to unfold/unstick it from the letter etc...
so it was like opening a letter from the bank - but asking for a job... and since luckily - we were actually after a designer for some bank clients... they immediately got the job on the first interview
 
DSM
Well played, then.
 
@tristan I like that
Well, I hate {t,g}roff, but the idea of having the CV as a manpage
 
@DSM it's probably a now done trick... but at the time... all of us were just "wow" - let's just meet to make sure he's not a complete twat, but barring that - he's got the job
Writing a covering letter than looks like it's from a bank in your own company's name, faking up a plastic card, attaching it to the letter as though it was from the bank itself - pure bloody genius
 
3:13 PM
does anyone know if/how to create a sqlalchemy ORM property as a stored procedure?
 
@WayneWerner don't think you can - you need to store them server side
 
Well, yes the stored procedure is... I just want to call thing.attribute and get back the results of a stored procedure
 
I'd be massively impressed if SA can transform arbitrary properties/hybrid properties into native SQL procedures per engine...
oh... that wasn't what I thought you asked
 
ah, yeah, no not that, lol
 
umm... doesn't func support passing a SP name and args?
 
3:17 PM
I always assumed ORMs are there instead of SPs, but that could just be my assumption
 
bbias
 
Yeah, but I can't figure out how to make it part of my class
that's the problem that I'm facing. I can do it externally, but it's technically a property of my class
I'm just dealing with a legacy database
 
Yeah ORM+existing DB is tough
 
Book chat. Yesterday I finished From the Earth to the Moon. spoilers for a hundred year old book: they don't actually make it to the Moon. I kind of figured this would be the case once there were only twenty pages left and they hadn't taken off yet. Not a lot of room for thrilling lunar adventure.
The craft launches, and earth-based observatories can see that they're in the moon's orbit, and... The book ends.
 
3:29 PM
Wikipedia tells me there is a sequel. I read the plot synopsis because I have had enough steampunk astronomy for the time being and can't stomach a whole nother book.
There's an interesting literary device that's employed 80% of the way through the book. The author is describing the spacecraft, and mentions that he doesn't fully understand the shock absorption system. He says he wrote a letter to Barbican (one of the ship's passengers) seeking clarification, and is patiently awaiting a reply. This lets the reader know that Babrican lives through his journey and ultimately returns to earth.
It reminds me of the bit in the Hobbit where Tolkien says "don't worry, Bilbo survives this particular harrowing event". I think just before his showdown with Smaug. Rather effectively defuses the tension.
In Verne's case it also lampshades the fact that no shock absorption system could possibly keep a human alive through 22 thousand g's of acceleration. Basically saying "lol idk how it works, ask the guy who invented it"
 
goooooood mooooorning room siiiiiiix
 
\o
 
Kind of how you know Dr Frankenstein lives through most of the story because he's telling it.
"Frame Story"?
 
TIL: Python 2's filter may also return a string or a tuple
Ehh
 
hm. interesting.
 
3:38 PM
Anyone that reads HP Lovecraft knows that a still-living narrator doesn't imply that they live happily ever after. How many times did he pull the trick of "... And even as I finish penning my tale, I can hear the shoggoths slithering down the hallway for me"?
 
And who can forget I Have No Mouth, and I Must Scream
 
wim
>>> filter(None, (0,1,2))
(1, 2)
>>> filter(None, [0,1,2])
[1, 2]
>>> filter(None, {0,1,2})
[1, 2]
weird
 
@vaultah I guess it's just an iterator in 3 so it can be whatever you want it to be: >>> ''.join(filter(lambda x: x=='l', 'hello cabbagetown'))
 
3:40 PM
@wim sets are always weird
 
wim
filter is a piece of shit anyway, so who cares shrug
 
I just commented on a Q that filter(...).replace will fail in Python 2 because lists don't have the replace method
and then actually ran OP's code
>>> filter(str.isalpha, 'abc123')
'abc'
 
So filter does some rudimentary type matching. Interesting.
 
looks like you'd have to do >>> ''.join(filter(str.isalpha, 'abc123')) in Python3
 
filter(None, is basically a hardcoded shorthand for filter(bool, ...
there's no magic
it just returns the truthy elements
 
3:44 PM
@wim I don't mind map/filter if they're directly using callables - if they're using lambas - re-write them as comps
 
DSM
@tzaman: no, there's magic -- see above!
 
I can't really think of anything more reassuring than the author (for storytelling purposes). It's like having God come down and say Everything's gonna turn out fine on this one, don't worry.
 
You can't actually use map(None, ...) if 3.x anymore anyway
 
DSM
There are unreliable narrators, though.. can't remember a book offhand where the author/narrator said "everything works out" and then it doesn't..
 
\Unless it's like House of Leaves or something with a notoriously unreliable narrator.
 
@DSM oh, the return type - right
 
@DSM sounds like the stanley parable :)
 
There's the source for 2.7's filter
 
It's the opposite of the General Lee going off a sweet ramp and the narrator says "It looks like the Duke boys are in a heap of trouble" and they cut to commercial
 
wim
why filter has such a weird interface
why it's not like filter(some_iterable, some_callable=bool) ?
 
3:47 PM
I don't know if anyone but me was curious, but tuple and string are the only special case types for 2.7's filter. and unicode if Py_USING_UNICODE is defined.
 
yeah the docstring for the func actually says "If sequence is a tuple
or string, return the same type, else return a list."
 
@wim It is in 3x
 
Aw man, I source dived when I only needed to doc dive.
 
wim
no it's not wayne
 
3:48 PM
@wim Presumably to fit with the rest of the library that takes a callable and then any number of iterables after it (which isn't the case for filter, but is the case for map, zip, dropwhile, takewhile etc...)
 
@WayneWerner no it isn't, py3 still has (func, iterable)
 
well, the other way around, rather
 
In 2.x, you could do this:
>>> a = [1, 2, 3]
>>> b = [3, 4]
>>> map(None, a, b)
[(1, 3), (2, 4), (3, None)]
 
that is strange that it's backwards from sort. I suppose foolish consistency?
Well, seems like it's consistent with map
 
in 3.x, you get:
>>> a = [1, 2, 3]
>>> b = [3, 4]
>>> map(None, a, b)
<map object at 0x7f2bae697cf8>
>>> list(map(None, a, b))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'NoneType' object is not callable
 
wim
3:50 PM
look at the argspec filter(function or None, sequence)
why function or None ... wtf???
 
and reduce, for that matter - that's probably why it's function, sequence
@wim You can pass None it a lot of places
 
None is special cased to be an identity function - lambda L: L or whatever
 
wim
of course I know that. it's just weird
it's like it's going to go and call None('a'), None('b') ...
 
Can't remember who it was that put a bug report out there saying that 2.x and 3.x behaved differently
while at the same time using a from __future__ import map didn't behave as expected...
 
I saw a Hitchcock film the other day and it definitely felt like he was doing everything possible to say "Main character is sooooooo gonna die" without actually saying it.
 
wim
3:54 PM
also saying filter(function or None, sequence) makes it sound like you can omit function , and just pass 1 argument. you can't.
 
@QuestionC That's fairly Hitchcockian, though
 
wim
map, reduce, filter, lambda can all go away and die in a fire as far as I'm concerned. comprehensions just fit better in the language.
 
Oh it was Gareth Rees - haven't seen them around in a while - bugs.python.org/issue19363
 
@wim seems you agree with Guido ;)
 
DSM
I have to admit I like map and lambda. I'm not saying I would have given up on Python if lambda went away, but I admit I'd have been more open to alternatives.
 
3:58 PM
@wim reduce has already been moved to functools
 
I don't care about map - (do_something(thing) for thing in things) is perfectly fine for me
lambda is occasionally useful
 
DSM
The boilerplate part (thing) for thing in doesn't sit right with me.
 
but I find that I'm more open to just using internal functions, e.g. ...
 
I like map(do_something, things) better. No lambdas, clean, virtually the same return type
 
wim
sits just right with me (but I usually use a one character name like 'x'
I like it because it looks like maths
 

« first day (2190 days earlier)      last day (2761 days later) »