« first day (2288 days earlier)      last day (2885 days later) » 

14:01
Anyone remembers that pycon talk about changing byte code? Who was it by?
love those accents
guess I should watch this all the way
It’s really interesting. A bit on the crazy experiments side, but very interesting
14:22
I can't deal with the pronunciation of cache.
\o cbg
Didn't watch the video but I'm guessing "cackie"
"kaysh"
twitch
That's better than "catch", though.
C̨̯̜̔̽ͮͅA͓͕ͭ̋̐̾̌͋́̀̕Ḇ͓͈͇̹ͦͤ̃̂͗͘B̫̼̗̂̓̌ͣ̒̕͠Â̞̦̒̎ͯ͘G̸̬̥̦̖͖͍̍ͫ͗ͦ̀͐́͟Ë̺̘̠̹͕͚̟̠ͪͩ͟‌​̗.̷̸̮̥̤͙ͥ͛ͪ͋͆̾ͪ͋͒F̿̋́ͨ͑͗ͥ̿̚͏̸̛͕̘̞̫͉̪R̡̛͕̲̣̬̩͎̺̩̘ͩ̊̀̍ͯͥ͛̈́O̭͓̯ͯ̈͐ͥ͛͒͘͟M̼̞̦ͣ͂̐̍̈͑͘͜͞‌​̼̜̦.̡̖̬̯̯͎ͪ̉B̩̬̲̙̱͚̠̘̺ͫͣ̆͋̔̂ͯͬ̀E̼̞̦̘̮̻͊͂̓ͫͮ͞ͅY̴̬̺̰̹̆̎̏̆̅̏͢Ŏͯ҉͉͇̤N̵͉͙̣͈͗̈ͣ͊̍̊ͭ̓̂ͅ‌​̙D̷̩̥͚̳̘̪ͣ͗ͫ
14:24
How long did that take Marcus?
5 seconds or so
Ẅ̷̨͔͓̞̣̫͔̻͖̼̻̜͓̮̿̄̅͛͒̏̈́̒͂͒̄͜ḥ̷̢̛̘̖͚̭̗̳͖̤̱͇̻̈́̏͆̈̾̔͗̈̄̍̑͝͠ý̶̢̧̛͕̖̰̈͑̋̐̎̉̇̅͌̓͘͠ ̴̨̟̮̖̺̀̈͐d̵̨̦̤̭͐̔̿̓̋̇̎̀͛ö̵̧̤̳͙͉̜̥̮́͂̉̿̂̚͝͝ ̸̠̠͔̘̱̩̭͇̼̯̯̙̱́̄̒͗̃͋͋̒ỳ̴̛͔́͗́̇̇̈́͝ơ̷̡̮̝̰̦̘͑̈́̈́̕ͅu̷̡̱̙͗̇͑̏͋̍̀̽̕̚͝͝͝ ̸̙̲̦̩͈̪̙̹̪͚̍̐͛̆ͅḁ̵̧̡̰̥̠̰̹̹̭̻̉̀̔́͝s̷̨͍̭̣̰̘̥̜̣͖̏̃͜ḱ̸̨̨̞̖̫̣̙͎͕̮̱͑̔̃̊̀?̴̓͆̔̿͗̽̄̆̑͑‌​̮
Time has no meaning in ᴛʜᴇ ᴠᴏɪᴅ
T̘̘̞̘̠̫̙͖̫̀̂̅ͭͨͯ̌̏͞͠͡I̥̙̫̤ͨ̀ͥͮ͑ͣ̊ͨ͠Mͮ̾̃̊̀̀͏̙͚͙̜̠E̤̳̿̔͒̅̃̀ͅL͖̳͍̹͂ͥ͂̑͑͜E̖͕͛͒̃͆͌͆͑́‌​͓̘͖͇̞̻S̞̞̯̙̻̀̂ͤ͒̐̊̄͒S͖̼͙̃͌͢͠N̴̛͎ͦ͒̈͜E̡̗̯̹̯̻̘̝̋̈͘͟S̴̡͕̤̲̼̄̐ͪ̊̾͂͝S̪̬̗̰̳̰̭̺̈ͮ͌̌ͭ̚̚̚͜‌​̦L͈̜͋͛̀͘Ę̩̬̲̯̑̿̾S͖̭̦̗̤͕̝̲͑͑͂S̡̬͚̘ͤ̈̉̾̄ͪͦ̄̚͡N̵̷̄̒ͫ̆̈͑ͣ̓̽҉̭͙̲͈͍̞̘Ẽ̯͙̦͚̗͆̑̉͛̕͞Sͣ͌͊‌​̳̟̦̘͍͚̓͌̔͂ͪS͎̬̥̮̺̫̫͚ͨ̆̋ͯ̈̍ͧ̕͟͡
I was wondering if you spent time artistically crafting it ;)
14:25
Bespoke artisanal zalgo
W̆͏ͅE͚͈̖͎̱ͪͤ̌͋͗͒ͭ͜͡ ̫͙̔C̵̢̖̖̞ͦ̓ͩͣ̀̉̅́R̭͇͉͇̰͛̄̅͒ͮ͗A̡̱̫̙̤̭̥̺ͤ̒ͤ͑̔̓̀͠F̢̉̆̕҉̠̯̝͈̟̰̞̦̦T̲̞̬̜̄̎̋̕ ̮̝͓̼͔̣̤͛͑ͮ͡E̶̸̼̪̮̩͇͚ͦ͐̒̑ͪ́V̷̵̧̫͎̜͉̩̮̪̀͌ͪ̄E̵̵̪ͩ̎̽̚R̴̻̻̎̈́͒̂ͪ̆͟͠Y͕͙͕̟͍̟̐̆ͥ͝T͛̑͛̐̂ͦ̃‌​̶̺͍̼͡ͅH̷̡̬̗̫͖͒ͧ̀́Ḯ̶̓͋͐̍ͯ͏̪̦͕̞N̨͕͎̖͕̞̥ͦͩͫ̐͐̔ͅG̍́̄͌̎ͭͭ̀̅҉͍̥͜͝
W̵̖̜̤̬̊ͥ̅̋ͬ̒ͣ͜͡Ę͈͖̺͚̲̉ ̷̵̭̟͍͖̉͆̓̕C̡̱̦͐R͓̝͂̌̏̓ͫ͌͢͝Ȃ̘͙̣̜̎͋̀͞F̷͎͖̙͙͎̀͛͑̊̑ͪ̅ͨT̡̨̟̮̯̗̖̙͖̼̳̓ͬ̽ͤͬ́ ͬ̇̀ͨ̍ͤ̓͂҉̦̱̻̺̀N̛̓̃̋̀̾҉̼͍̠̻ͅO̭̰̜͎̼͓̐ͥ͌͞T̶̳̫̮͙̱ͫ̔ͣ̿ͯ͡H̵̴͍̪̹̜̝̠̥͎͓ͪỈ̜͍͖̗̣ͩ̇̅́́͝ͅN̂‌​̨̭̰̦̽̈́̿̀͢G̠̲͖̯̞ͩ̆̈ͫ͑̆ͅͅ
oh no, I forgot that some code needs to be compiled... too used to interpreters :\
@IntrepidBrit “cash”
cabbage all
it's raining cats and dogs in San Diego
Aye, that's how I'd pronounce it.
14:35
Let's make it rain cabbages here
C͎͉͎͎̳͎̤͎͠O͎̱͎̰͎̲͎͎͎͌̓M͎͎͎͎͎͎͍͎͑͂̿̚͝P͎͎͔͎ͣI͎̰͎L͎͎͎ͪ͞I͎͎͎͎͉͎̝͎͓͎͑̆̇N͎͇͎͎̩͎̙͎͎ͧ̂G͎‌​͎͎͎͎͎̈̓̚҉͎ ̧͎͎͚͎͎͞I̧͎͎̥͎S͎҉͎̹͎ ͎͎͎̮͎̏̀Ţ̶͎͎͎͎͎͈͎͎̈́̔͝H͎͎͎̘͎͑̕È͎̜͎̘͎͎̥͎͎̝͎͂ ͎͎̆----͎̯͎̗͎͎͎̇͘-͎͎̯͎͎͎͎̌̆͟ͅ-̸͎͎͎͎͎̫͎͕͎͊̓̓W͎͎͎͕͎͎͙͎͎̆̕Õ͎͎͇͎͇͎̼͎R͎͔͎͎͎̾̕S͎̭͎̖͎͎͎ͩ̌̚‌​͎͎̌T͎͎̠͎̏҉͎-͎͎̔͏͎-̨̨͎͎͎͎͎ͪ͛-͎͎͎̖͎̩͎͎̗͎ͧ͊͋---- ͎̥͎B͎͎̖͎͎͎̼͎͎ͥ̈́̇̕E̵͎͎͕͎͙͎͎̝͎͕͎ͤS͎͎͎̙͎͎͔͎̿͛͞T͎͐
I guess I can't strikethru zalgo
@poke remember that bytecode is now wordcode
huh?
@poke they totally changed the internal representation of bytecode in Python 3.6
all opcodes are now 16-bits wide
oh
that’s what you meant with “word” instead of “byte”, heh :P
But that’s all? Double sized op codes?
14:43
yea, but the decoding is faster, it is also aligned.
actually they should've gone with 32-bit opcodes :P
but with wordcode the bytecode is actually smaller :P
heh
any one know any good resource for pthread and mpich library where every thing is defined with example
19 hours ago, by Andras Deak
Additional info on my debian leaking memory: sar tells me the missing memory is in a bucket called
19 hours ago, by Andras Deak
> kbslab
Amount of memory in kilobytes used by the kernel to cache data structures for its own use.
19 hours ago, by Andras Deak
does that say anything to any of you?
14:58
Q: What's worse than calling sys.setdefaultencoding? A: Doing it in a loop! stackoverflow.com/questions/41766447/…
Why is it always web scraping?
glosses over confirmation bias
@PM2Ring not to mention reload(sys) in a loop
@AndrasDeak I didn't mention that because I didn't want to spoil the surprise. ;)
I hate surprises:P
15:07
ahoy @justastudent
hello
i have a question about matplotlib
@AndrasDeak SURPRISE!
@justastudent sopython.com/chatroom read the rules buddy, tl;dr: just ask your question
:|
there's no tl;dr for the rules, just go and yamming read it
@IntrepidBrit That typo is so common that many people, especially those who aren't native English speakers, think that it's the correct term. We discussed that here a little while ago...
Dec 30 '16 at 14:01, by Andras Deak
it's not scrapping, it's scraping
I think he just meant that the crappiest of the crap are about scraping
15:10
On a related note: see TV Tropes Rouge Angles of Satin
Yeah, that was my intended point :)
quick aside: anyone have a good recommendation for an android meeting recording app? Preferably with auto transcription?
I've gone with a few in the past, but there's always some little feature missing that drives me up the wall (ie - no easy sync with dropbox or google drive)
@justastudent don't forget to ask your question when you'll have read the rules
@AndrasDeak yea ty, but I think I might have found something on my search for the problem xD
good job:)
I need to do some data visualization this week. We're going to be playing Risk at board game night and I want four hundred tables each describing the likelihood of outcomes of a battle between N attackers and M defenders with 1 <= N, M <= 20.
15:23
sounds like fun
I already wrote the code to calculate everything, I just need to render the bar charts.
you only need only need 210?
And I need a cunning plan to sneak all this data to the table without anyone noticing.
I could put them all on my phone but scrolling to the one I need seems impractical
is determining the outcome complicated?
Probably easier to type in N and M and have the result appear as you type
15:27
It takes somewhere more than O(N*M) time to calculate one outcome, but it amortizes very well if you cache results
since outcome(N,M) is determined from the values of outcome(N-2, M), outcome(N-1, M-1), and outcome(N, M-2)
I reckon you should model this using a neural net
@AndrasDeak hmm?
@AnttiHaapala if you read the transcript following my first message link, it might make more sense
quote syntax is lost when I'm quoting my earlier message:/
slab allocator is the one used by the kernel for its own data structures'
OK, but is it normal that it takes up a buttload of mem when nothing's using it, and that it allocates new memory when needed instead of freeing up from the slab?
15:30
user memory isn't allocated from slab at all
@Kevin You could always use kivy
@AnttiHaapala oh, I misunderstood what you wrote
so that's debian itself that takes up that memory?
I actually need something more like eight hundred charts because we're playing Risk Legacy which has additional rules like "when defending a country with a depleted supply line, subtract one from your highest die roll" and "when playing as the Saharan Alliance and you roll two sixes while defending, the attacker can no longer attack that country this turn"
user memory is allocated via buddy allocator in 4 kb pages.
basically your or the system or something program is using some kernel resource that takes ~<1 k apiece memory...
cbg folks
how we all doing today
15:32
better than I deserve
@AndrasDeak see also /proc/slabinfo
can you spot the large number in there?
I hate Risk. Largely because it takes so long to play a darn game.
@WayneWerner I hate it for other reasons, namely everyone gangs up against me
it's not my fault I'm good at board games!
It was slightly better on the computer where all of the movement and allocation of pieces was pretty automatic
15:34
I've discovered that I pretty much just like co-op games. Although I'm fine if it's a "my team vs. your team"... sometimes :D
36666 rep, this is a good number
A cursed number, but a good one.
@Kevin how about playing a game called "risk" in the traditional, gambling kind of way?
@AndrasDeak mmhm <:P
@AndrasDeak are you still having the problem right now?
yes
I'm trying to figure out hte header of slabinfo
# name            <active_objs> <num_objs> <objsize> <objperslab> <pagesperslab> : tunables <limit> <batchcount> <sharedfactor> : slabdata <active_slabs> <num_slabs> <sharedavail>
I suspect either active_objs or active_slabs is what you meant
'cause I have various huge numbers:D
dma-kmalloc-4194304      0      0 4194304    1 1024 : tunables    1    1    0 : slabdata      0      0      0
@AndrasDeak active_objs or num_objs
15:37
biggest one ^
hmmm that is not in use :D
active_objs is 0
kmalloc-4096      493001 493006   4096    1    1 : tunables   24   12    8 : slabdata 493001 493006      0
next biggest one ^
hmm
that's more like it.
malloc sounds very leaky to me:P
that tells kmalloc has been used to allocate 493001 items of 4k...
compare with my
kmalloc-4096 968 1232 4096 8 8 : tunables 0 0 0 : slabdata 154 154 0
15:39
ah I see, kmalloc-* says *-sized chunks
I have kbslab=2080725 right now
or my desktop that has been on for 50 days:
kmalloc-4096 571 632 4096 8 8 : tunables 0 0 0 : slabdata 79 79 0
I'd like to see something like that:/
since I've switched to debian, my memory's been leaking after a few (5-6-8) days
indeed looks like something is leaking something
I used to reboot every other week or rarer
that is 1925M reserved via kmalloc, not sane at all!
can you check dmesg for something fishy?
15:41
I already have but didn't see anything that is fishy <to me>
9
Q: Baffling Memory leak. What is using ~10GB of memory on this system?

Mike ConigliaroAfter running for about 18 hours, this system is using ~10GB of memory, causing the OOM-killer to be triggered when we run our usual tasks: # free -h total used free shared buffers cached Mem: 14G 9.4G 5.3G 400K 27M 59...

I'm a pretty weak link in this problem:D
@AnttiHaapala ah yess, mine is similar: lot of allocated mem with no process behind it
@WayneWerner I once had a game of StarCraft The Board Game last 3 nights
it was intense
@AndrasDeak very probably a misbehaving driver.
I guess it is possible to trace which module uses kmalloc but I don't know how
15:43
@idjaw There's a board game?1?!?!?! I need to buy it now...
Oh btw cbg \o Joe. If you didn't know Overwatch is having a Chinese New Year event, looking like Mei and D'va getting some special skin (not sure about the other heroes).
thanks for the help, @Antti
@idjaw Yeesh. Prime example of things I'm not into, lol
the GoW boardgame was fun... except you seriously cannot beat the Beserker level with more than one (maybe two?) characters
More like bored game, eh? *snicker*
There's leaks of Rein and Hog getting skins too
we got owned so hard with 3 people. Too many wretches spawning
15:49
my newest big annoyance: gigantic boilerplates that try to include every conceivable thing
Russell's Boilerplate?
just want a config file at the base level and some dependency specifications with a single example. The JS ones try to include everything they possibly can.
@WayneWerner Risk Legacy is apparently better at this. You don't need to kill every other player to win.
You only need to get to four Victory Points, which are acquired by 1) capturing an "HQ" country, or 2) trading in four of the cards you get each time you win a fight.
So in theory the game could end after only 12 battles
Our first session finished in an hour and a half but I expect next time to be faster because we know the rules now
I've been getting into Civilization for the first time in my life and so far that appears to be a mistake
That's better than the 6 hours or so that most games I know of tend to take :P
@AnttiHaapala scary domain
I love the story behind OP Gandhi (IIRC something to do with setting an aggression level to -1 or something and it wrapped back around to 255 in testing)
@AndrasDeak you can enable it in a running kernel it seems
even scarier:D
I have no /sys/kernel/slab
you don't?
are you running debian 1.0?
do you have /sys/kernel?
or is it that sysfs is mounted elsewhere or st
I do have /sys/kernel/slab/kmalloc-4096 with 31 files and a directory
15:57
I have /sys/kernel, I'm running debian testing (uname says Debian 4.7.8-1 but I don't think that's actually the debian version)
uname -a?
Linux terminator-450 4.8.0-22-generic #24-Ubuntu SMP Sat Oct 8 09:15:00 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
hmhm
but it should have that debugging always ... strange
this is rather old stuff...
Linux hostname 4.7.0-1-amd64 #1 SMP Debian 4.7.8-1 (2016-10-19) x86_64 GNU/Linux
it is debian version
cool, I wasn't really sure
I mean, I came to the conclusion sometime in the past that it's not the version
(don't remember the details)
Why Debian (just curious)?
16:00
anw, I'd go to /sys/kernel and try find -name slab\*
@MarcusS I was almost happy with ubuntu and didn't want to stray much
Almost?
@AnttiHaapala nothing
./debug/tracing/events/vmscan/mm_shrink_slab_start
./debug/tracing/events/vmscan/mm_shrink_slab_end
that's all that has slab in it anywhere in /sys/kernel
16:02
then I'd try rebooting and setting that debugging stuff on the cmdline...
anyway, don't worry about it, I've already taken too much of your time:) Thanks again
I'll try googling around some more now that I know that it really is a leak
I guess you'd want to trace U,kmalloc-4096
but this is fun
you dare to take away my fun?!
haha:D
I'll probably have to go afk in half an hour, heads-up
remember that @IljaEverilä and I programmed a kernel
didn't know that:)
16:04
we're kernel programmers :P
didn't know that either:D
not "linux kernel"
but "a *nix kernel" :D
what's with you Finns and kernels anyway?
dark winter nights, no life
OK, I found slabtop and it's nicely showing kmalloc-4096 up top
16:06
good but
I'd try to find out if it is indeed using a) slub-allocator (I guess it should
I think it just uses whatever's in /proc/slabinfo
If I do find a way to switch to slub, is it not possible that the problem won't even be there?
or is a leak like this likely independent from how memory is managed by the kernel?
Note that Debian and other distributions have gone back to SLAB because it is faster on multiprocessor systems. See: lists.debian.org/debian-kernel/2012/03/msg00944.htmlAriel Dec 1 '14 at 9:54
ahha :D
that explains it...
so you cannot turn debugging on that on when it is running
that kind of makes sense.
@AndrasDeak TIL thanks :D
so you'd just want to find out how to debug the slab allocator instead
I see
So there's a process (or whatever) in my kernel that is causing the leak
yes but I guess it is even possible to find whichever file actually allocates the memory
so down to "oh this driver is faulty"
bah, I do have to go afk, sorry to keep you hanging:P
I'll look at this when I get back
16:15
Cabbage
hmm ya
I am idling watching trump and stuff...
so doesn't matter
[x.strftime('%Y%m%d') for x in dates_list] Can this be implemented with map? map(?, dates_list) ?
Anything implemented as a composition can be implemented with map
@MYGz yes, but not necessarily with a direct method access, need a lambda function or partial
16:18
Duh. Forgot lambdas :D
Is there a reason to prefer map over the composition? I only do it when it saves enough space to fit the line better
>>> functools.partial(datetime.datetime.strftime, format='%Y%m%d')(datetime.datetime.now())
'20170120'
Hello All
I need help in Python
This is the question
In Python I am using Gradient Boosting and it is giving error
@PuneetMathur read the rules buddy : sopython.com/chatroom
@MooingRawr Got it will stay quiet
16:24
:D
@MooingRawr good luck finding StarCraft. It's out of print, and last I checked, the eBay prices are ridiculous
I'm kicking myself for not buying the expansion, because it is now in the hundreds, when I could have boughten it off Amazon for 35$
@idjaw I'm hoping that since the game is dying in hype, the price will reflect that ...
16:27
@MooingRawr Has nothing to do with the video game at this point. Board Game world is a different animal.
@PuneetMathur your data is really in wrong shape :D
@PuneetMathur GradientBoostingClassifier seems to be a single-class classifier
@idjaw Well I remember when Star Wars board game fell in price before 7 came out, than went back up....
@AnttiHaapala Thanks for your help
@AnttiHaapala How to rectify or convert it for this classifier
I am not a sklearn expert but you'd probably need to use it in OAA or similar setup, training several classifiers
@MooingRawr ok. good luck :)
16:29
which supports 1 or 2D results
@idjaw Hey the lottery is 50 million this week, ;3
I just want to go home and play video games
plus I ate way too much smoked salmon. Starting to not feel right
so it supports it out of box, but I guess you need to apply a number to each class
@idjaw What source of magic is 'too much smoked salmon' ? Also, it's Friday, video game all weekend long! (is my plan, I think I'm pick up Diablo 3 again)
github.com/django/django/pull/7867/files :-O (Django 2.0 dropping Python2 support, woo woo!)
16:33
@idjaw one. cannot. eat. too. much. smoked salmon :D
hi all I'm still pretty new to Python so I need to know. Do I need to choose which version between 2.7 and 3.x to use?
@mojo706 You do not need to choose, I've chosen 3.x for you.
@AnttiHaapala haha
@mojo706 the rule is: use 3.latest you can find, and if you have problems with some libraries that seem to require python 2, come here and complain about them :D we might be able to find alternatives.
6
Noted. Thank you
DSM
DSM
16:37
Plus 3 is better for beginners in lots of ways which won't make sense to you because you haven't yet learned how 2 does things in wrong ways. :-)
I haven't found anything in the past few years that couldn't be ported to Python3 with fairly little effort. Anything that's big enough to matter probably already supports 3
@AnttiHaapala Which is why I never stop.... :P
I bought a small package on purpose, so I can finish it on my own
@AnttiHaapala Thanks for giving me some pointers it will really help
DSM
DSM
There's a Tableau API they use here at NumberFirm which is nominally 2 only, but they publish the code so I was able to make a 3-compatible version which works for me. That's the only one I've hit recently.
> With that, we successfully raised the shared memory of each worker process from 140MB to 225MB, and the total memory usage on the host dropped by 8GB per machine. This saved 25% RAM for the whole Django fleet.
16:40
Is there a place I can get recommended learning resources. I know of learnpythonthehardway
I've almost completed codecademy
Serious question: are there any programming languages where you really would prefer an older version over the newer version?
I'm mainly into data science
"Ew, don't use KevinScript 3, the devs ruined it. Use KevinScript Classic"
DSM
DSM
@Kevin: setting aside translation costs, so for a new project with no legacy commitments?
yeah.
Notably,
> We strongly recommend you don’t use Learn Python The Hard Way. It contains some “interesting” decisions, and its structure tends to lead people into asking premature questions.
it's cool to still want to be Gabe Newell when I grow up right?
Works for me
DSM
DSM
Then no. There are certainly changes I don't like in various languages, e.g. the new typing syntax they probably use in Woolerton (pause for spit), but I definitely prefer modern Python on the whole. And modern C++ is way better than older, modern JS is better than older..
@mojo706 The official Python tutorial is more than adequate. And if you get stuck/confused there's always asking (good) questions here.
When they introduce mandatory type annotation in Python 4000, you'll sing a different tune :-p
16:45
Lol.
I'm pretty sure Guido has said that's a "never"
thank you, just book marked them. I've been on Ask Ubuntu for a while, haha I've been taught to ask good questions
That's neat: github.com/daleroberts/itermplot If I used the plots more I'd probably pick that up. As it is I just use Jupyter notebooks
@mojo706 first when you've got a python question, go to google, then enter your question followed by site:stackoverflow.com
open the first 5 links :D
@AnttiHaapala noted
16:48
Every time I use the SO native search I just go back to google, because one of these things their business is search.
because we will ridicule you if we can take your line from the chat, enter it into google and the first search result is the answer :P
Usually I just stick to passive-aggressiveness in that case
DSM
DSM
I try to do site-specific searches using site:stackoverflow.com on google, which works for the first page but when I go to page 2 it's broken that apart into "site stackoverflow.com". Does anyone else have that issue?
That's interesting... can't say I've ever been to page 2
16:50
I don't usually add site:stackoverflow.com to my queries because SO posts usually float to the top all on their own
@DSM just tested, works-for-me tm
I don't look at page 2 of search results. I get to the end of page 1 and give up.
@Kevin me neither, but... in case they don't
If google can't find it in ten tries, it doesn't exist
DSM
DSM
16:52
.. and of course I can't reproduce it, after just having mentioned it. But seriously, this has been annoying me for quite some time.
I wonder if anvaka.github.io/common-words/#?lang=py is counting the contents of comments... Is a truly the most popular one-letter variable name, or is it getting an artificial boost from also being a word?
They probably are counting comments, which explains "the"'s high rank better than "it's a really popular name for some reason"
@Kevin click on "a" and you'll see
That's super neat, though :)
DSM
DSM
Huh. Wonder if that's an argument for implicit self.
16:55
Ok, so roughly 37k of them are names. But s has a similar problem because it counts words ending in apostrophe-S, and it counts the %s in old timey format strings.
@Kevin github.com/anvaka/common-words is probably worthwhile to read
Congratulations x on being the highest ranked one letter name that is unambiguously used only for names
Dear the letter X: you've been neglected by modern English for five hundred years, but baby we'll treat you right. Love, programmers
@DSM Yeah, I was thinking the same thing. At least it's easy to type.
Dear programmers: Step off, you've got flash but we've got history. Cordially, mathematicians
@WayneWerner That's a slick breakdown. If only every README was as informative.
@AndrasDeak I am listening to Orban Soini well...
@DSM I'm pretty happy with the explicit self. Plus it removes the need to do any kind of weird hackery by the implementation in injecting self in the locals for every method
I wished for implicit self in javascript using my monkey's paw and now sometimes it points to the Window object during callbacks
17:06
@Kevin use es6 and arrow
DSM
DSM
@WayneWerner: I don't mind it that much, but if it weren't there I also wouldn't have asked for it.
The only thing I don't like about explicit self is the questions by confused newbies asking "why is x.y(z) saying expected three arguments, got two when I'm giving it only one argument?"
"explicit self" is explicit on definition, but not use. It's misnamed.
DSM
DSM
I'm a little surprised we haven't changed the error message to something more enlightening by now.
#patcheswelcome
17:12
Confusing error messages as casual filter
@DSM so what should it say?
i.e. which wording?'
"x.y.z expected three arguments (including implicit self), got two
but it cannot really be fixed.. :/
I'm guessing that by the time the error needs to be raised, the interpreter no longer knows that the function being called is a method.
DSM
DSM
Eh, something like that. I might even publish the function signature and draw attention to what might be happening.
@Kevin exactly
you could wrap it but what if the method is decorated ... or sth
DSM
DSM
Maybe I'm missing something. When we call a method, we don't pass the class instance: Python handles it. So it must know it needs to pass it, and if it knows that, why can't it mention it?
17:18
a sec...
My intuition is that the part of Python that handles self for you is separated from the part of Python that raises TypeErrors on bad function calls, to the extent that it's hard to get one to communicate with the other
Not that I've ever seen anything in the source that confirms this. It's only a feeling.
Also the anthropic reasoning: if this were easy to implement, we wouldn't be having this conversation, because it would have been implemented
A function's __get__ binds the instance to it, there's no reason it can't handle changing the exception there.
I think that most of the people with the know-how to fix it already understand the gotcha and don't think it's important to fix.
Hmm, how hard would it be to distinguish an "incorrect number of arguments" TypeError from every other kind of TypeError?
DSM
DSM
That's plausible enough. It's also possible that there's a performance cost which every happy path would then pay just to improve the error message, though that seems a little unlikely to me.
@Kevin actually :P
>>> class Foo:
...     def bar(self, x, y):
...         pass
...
>>> Foo().bar(5)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: bar() missing 1 required positional argument: 'y'
so this error now only occurs when the number of arguments is exceeded
>>> Foo().bar(1, 2, 3)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: bar() takes 3 positional arguments but 4 were given
17:28
More generally, is it possible to distinguish between errors raised by the interpreter, and errors raised by the user's code?
@Kevin not really, not that it couldn't be
oh, and all this time I thought it was because seven was a registered six offender — USER_8675309 yesterday
@KevinMGranger trololol.

« first day (2288 days earlier)      last day (2885 days later) »