« first day (1646 days earlier)      last day (3296 days later) » 

1:00 PM
so I know where and what to fix when they are ready
 
@PeterVaro are you prepared to accept NULL in for kw and args?
 
sure
 
hmhm
coffee and then back to polling station :D
 
@AnttiHaapala before that
I have a question, which I cannot find any answer for
 
then ask :D
 
1:02 PM
I want to add a property-like object to my type, something like:
 
C or Python?
 
class MyClass:
    @property
    def attribute(self):
        return <some-value-after-calculation>
 
I am nto sure about C really, I never did properties yet
 
but with the C API ofc
 
ah just read only
 
1:03 PM
nope
I alreade have those with PyMemberDef
but those are only available, if those values are available in your base-struct
 
so what do you want to do ? :D
 
but what if I want to calculate things first and then return the calculated value on-the-fly?
I cannot add a pointer to function as one of the items of an array in the PyMemberDef struct
 
I think I've already tried that.. without any luck..
 
search for PyGetSetDef
 
1:05 PM
let me try again then..
 
it is different member
@PeterVaro btw if you need this:
 
ahh.. I didn't find that specific page you linked
 
@AnttiHaapala that's what I've found
@AnttiHaapala I don't need setters for now, only getters
 
so I'd try that :d
and if it does not work, then post another bug
@PeterVaro seriously reported Date: 2011-03-17 16:17
 
1:13 PM
:/
 
that is more than 4 years before,
I'd say, python is dying
because ... who is fixing the Python core?
everyone just fiddling with some library...
matrix multiply etc... :D
 
@AnttiHaapala Maybe they're fiddling with libraries because many people complain that not enough libraries are Python 3 compatible...
 
@PM2Ring no I mean standard libraries
 
Ok. I agree that repairing bugs in the core should have priority over adding enhancements to the standard libraries.
But maybe enhancing libraries is a lot easier & less scary than core bug-fixes. :)
 
I could post a patch for this, would be my first for CPython :D
 
1:18 PM
@AnttiHaapala nah.. I won't go that far from a silly little bug like that
 
yes, and that is the problem
@PeterVaro not the first
 
I mean, it is clearly not a top-priority problem
 
so what is? :d
 
hmm.. anyway, the PyGetSetDef did the magic, thanks for the tip
 
it is 4+ yrs old regression from Python 2 compatibility
 
1:19 PM
I clearly understand that -- and yes, it would be nice to have it fuixed, however, the work-around is just so damn simple
that I don't prioritize it as a seriuos bug.. more like a quirk
 
stackoverflow.com/questions/29730097/… terminate with extreme prejudice
@PeterVaro Quirks are for JavaScript, not Python. ;)
 
@PM2Ring sadly enough.. but yeah.. :)
 
1:32 PM
@PeterVaro it is a bug
 
1:53 PM
:facepalm: Newbie's text processing program is giving mysterious bugs. It turns out his data was not a plain text file - it's in an RTF. stackoverflow.com/questions/29730239/…
 
lol
 
anyone know how to fix this unorderable types error please? I am using one argument and within the script I have accessed it as follows: if math.fabs(c-60) < sys.argv[1]:
I have tried surrounding the arg with int() but still get an error
sorry, its worrking now
 
2:09 PM
I did my first very serious python program :D
 
user559633
2:32 PM
@Ffisegydd 'The author of the book, Josh Holtz, expressed his disdain to us. “I thought that people would want a realistic look at the startup life. Tim Ferriss is lying to you.”' nice
 
@makallio85 if you dream hard enough you may go on to do even bigger and better things Ö
 
3:17 PM
@makallio85 Skynet's just around the corner. :)
 
I want a new close reason: 'Questions which cannot be answered without also winning James Randi's million dollar prize are off topic. Please do not ask us to be omniscient, omnipotent, or anything else that starts with "omni."'
 
:) It's annoying when people start making wild guesses as to what the OP really means, and then start writing answers based on those guesses. It's even more annoying when they guess right. :) Eg, this gem I linked to earlier stackoverflow.com/questions/29730097/…
 
@PeterVaro more blues
 
@PM2Ring They utilise the power of the cabbage ball...
 
3:33 PM
@JonClements I guess so. There's nothing wrong with making educated guesses, but IMHO you should prompt the OP with comments first to verify those guesses before posting answers. OTOH, it doesn't hurt to start working on an answer while waiting for verification...
@JohanLarsson Nice. I'm glad I'm not the only blues fan here.
 
@PM2Ring ping me if you have gems. I have a low frequency gem trading going on with Peter. ~1 per month :)
 
Here's some recent Finnish blues Erja Lyytinen - You make me so sad
Erja's also a great slide player. But speaking of slide, check this out: Joe Bonamassa & Robert Randolph & Pino Daniele - Going Down (LIVE HD)
 
cbg @Martijn
 
@PM2Ring Must be hard to combine blues with fitness on that level, endorphines could mess things up :)
 
Perhaps. FWIW, Erja didn't tour much last year - she gave birth to twins early in the year. But she seems to be back into the swing of things now.
 
3:46 PM
@makallio85 btw, personally I prefer (Py)Qt/<insert your favorite toolkit> for anything beyond a simple dialog, Tk is pretty old and devoid of features
 
@PM2Ring nice
 
As you might guess, you have to be fit to play that well and that fast.
OTOH, being a little overweight doesn't seem to slow this young lady down: Chantel McGregor Band - A New Day Yesterday. FWIW, that's a cover of an old Jethro Tull blues-rock number.
Rhubarb time
 
rbrb boys
 
i saw this in a code: import sys;

def output(s):
sys.stdout.write(s + "\n");
sys.stdout.flush();

Isn't this same thing with print(s)?
 
4:10 PM
I guess it should have the same effect, but it allows you (for example) to mute all the input quickly by just commenting lines
Although I don't know why it uses sys.stdout explicitly
 
i didn't understand the muting part, also in this code, there is lots of ; and i couldn't figure out their usage
 
ah, ; are unnecessary in python... it was probably written by someone used to code in c/somethign with semicolons
and you can easily rewrite that to:
def output(s):
pass
And output will be quite
although my guess would be that it was written by some java programmer that is just used to...
System.out.println("Hello, World");
 
@Vyktor thank you very much. last thing to be sure: you mean def output(s)
print s
pass
right? if so, why using pass, if not how can it be same thing?
 
I meant that you may use `output` just to print debug messages and in future you may want to get rid of them, so you will just make output that will do nothing :)
(although logging is much more clever way of doing that)
 
thank you agai
n
 
4:25 PM
@makallio85 only downside with pyqt is that it uses the gpl license, where as with tkinter you do not have that restriction
 
5:02 PM
Sigh.
Can you please summarize the link you've included? Link only answers are generally frowned upon. — TankorSmash 2 hours ago
Someone missed the point somewhere.
 
Martijn, ti could be worse :)
 
@BenjaminGruenbaum tsk tsk, do I need to point you to our room rules? :-P No advertising of recent questions here!
 
Look at you, all moderator like
 
:D
/me grabs popcorn
 
I already commented on the post, and those that are interested in such discussions, well, already follow meta already.
@Vyktor Now I really had to follow through, with an audience like that..
 
Boo!
 
5:31 PM
@MartijnPieters you mean deleted chat reply or the comment you've mentioned above?
 
@MartijnPieters huh?
 
waits for people to be scared
 
@BenjaminGruenbaum It's what we do here with new posts being advertised! It's number 1. on the Posting Questions Links section:
> 1. Do not link your recently posted questions in the room. The main site is the dedicated space for posting questions, and having them answered.
And the vote count for me in the election just went down a couple of notches..
 
:D
Are you like nervous about the results?
 
@MartijnPieters I'm not asking for technical help with Python, I'm asking for feedback from this particular community (the Python room) on a meta issue. I don't think I'm the target of that rule. Also, it's not the main site, it's meta. If you don't like it here that's fine I don't mind really - it was just relatively well appreciated when I posted meta topic I posted and generally interesting ones before.
 
5:37 PM
@Vyktor Nah, nothing I can do anymore at this point.
 
I'm certainly not going to argue with you about it, I just found it somewhat odd.
@Vyktor why would he be nervous?
 
@BenjaminGruenbaum sure, and there are normally plenty around that'd enjoy the discussion, but those are already hanging out in the election room too.
 
@BenjaminGruenbaum election results anticipation...
 
I was interpreting the rule as applying to all questions, not just Python ones.
 
@Vyktor I don't know a single person who did not vote for the @MartijnPieters
 
5:39 PM
@Martijn to be fair... as @Benjamin says we've never enforced that rule re: meta posts from well known members of the community.... Benjamin's posted ones here before that may be of interest to the members here...
 
@JonClements I'll be happy to move it back; I was more in a teasing mood when I did that than anything else.
 
@MartijnPieters I really don't mind it being trashed, I just found it odd. When rooms have that rule it's usually to prevent people who have "urgent" work and "need urgent help" with their "how do I add 1 to 1 in numpy" questions or something like that.
 
Heh, thanks I guess - I was more curious about the etiquette than I cared about the meta post link.
 
@BenjaminGruenbaum I was just curious...
 
5:41 PM
Well... I noticed the :P but looking at the conversation, perhaps it wasn't interpreted as such... anyway - it's restored... let's move on :)
 
Good old days on IRC seeing people argue about rules with IRCops :D always ending in k-lines
 
@BenjaminGruenbaum More a case of misjudged bantering than etiquette.
 
5:54 PM
@MartijnPieters ok, remind me to ping you about that in two days. — Benjamin Gruenbaum 9 secs ago
:D
So, in surprisingly on-topic news, what do you guys think about the async-await proposal?
 
@Benjamin think I glanced at it... but can't honestly say I've read it properly
 
6:07 PM
"proposal to add async/await in Python" :o
 
That's not going to go anywhere, not with a link in French. Not much helpful commentary to be found either.
 
already on hold
 
it's still garlic
 
@ChillarAnand yes, but do you think it'll be edited into a real question? Or will it just accumulate more snark?
 
Wow... a big Python name - welcome @MarkDickinson :)
 
6:19 PM
talked 931d ago
 
does any one find python traceback annoying?
 
@Vyktor so? Alex Martelli was silent for years too, before his recent comeback. :-)
@ChillarAnand Troll much?
 
cbg
 
@MartijnPieters nothing, just curious... I'm still getting use to this chat
 
6:22 PM
Down with fever, still on StackOverflow :)
 
cbg and rhubarb
time for pancakes and Sci Fi.
 
ooo - what sci fi?
 
rhubarb Martijn!
@JonC remember the ques about bar codes last nite?
I added some timeit stuff
 
@MartijnPieters i kinda feel it is annoying. replaced it with custom traceback
 
6:24 PM
@ChillarAnand why annoying?
 
for even simple error is shows ~30 lines of traceback. it wont distinguish user files and system/3rd packages
 
Oh this reminds me I need to ping the issue I opened in October 2014 again
 
which issue?
 
The issue on bugs.python.org
They're so bloody lazy
 
may be they are waiting for us to fix it
 
6:37 PM
They couldn't find time to review 193 lines long patch from one of their core devs, who "fixed" my 187 lines long patch
 
1
Q: How to plot ROC curve with scikit learn for the multiclass case?

john doeI would like to plot the ROC curve for the multiclass case for my own dataset. By the documentation I read that the labels must been binary(I have 5 labels from 1 to 5), so I followed the example provided in the documentation: print(__doc__) import numpy as np import matplotlib.pyplot as plt fr...

 
@johndoe Not many members around. Blame Sunday ... :) You've gotta wait for a little while
 
 
1 hour later…
7:53 PM
Rhubarb all
@BhargavRao Rhubarb
:D
.
 
8:45 PM
Hello :)
I'm new in Python, comming from a Javascript background
 
Hi there
 
9:02 PM
heyy
I need some love, I felt like I wrote this answer nicely, but no response :(
 
@PascalvKooten it's been 13 minutes, on Sunday evening.
Give it time.
 
Yea, I never seemed to have noticed, but "sunday" appears to be a real thing
I guess most people answer during work
hah
 
What's wrong with my code
def anti_vowel(text):
    result = ""
    for char in text:
        if char not in ''.split('AEIOUaeiou'):
            result += char
    return result
 
''.split('AEIOUaeiou')
 
oh its the other way around
 
9:13 PM
you can do simply if char not in 'AEIOUaeiou'
 
oh ok thanks
 
a string is iterable
 
cool
 
and split, you would use split for like 'a b c d'.split(' ') --> ['a', 'b', 'c', 'd']
 
So why .join is the other way
 
9:15 PM
yea, good point
565
Q: Python join, why is it string.join(list) instead of list.join(string)?

Evan FosmarkThis has always confused me. It seems like this would be nicer: my_list = ["Hello", "world"] print my_list.join("-") # Produce: "Hello-world" Than this: my_list = ["Hello", "world"] print "-".join(my_list) # Produce: "Hello-world" Is there a specific reason it does it like this?

 
How do you repeat a letter?
for example "*".repeat(3)
 
'a' * 10
 
what
loool
 
don't try to add though ;)
In fact, whenever I need an error (sometimes to just exit code), I use 'a'+1
our little secret lol
 
def censor(text, word):
    words = ' '.split(text)
    for w in range(0, len(words) - 1):
        if words[w] == word:
            words[w] = "*" * len(word)
    return ' '.join(words)
What's wrong
 
9:18 PM
range is <>
close ended?
if you say range(0,5) you will get 0,1,2,3,4
so you don't need to - 1
 
oh
 
also
if you just give 1 arg to range
 
Still doesn't work
 
it will assume 0
range(len(words))
 
ok
still doesnt work
censor("hey hey hey", "hey")
 
9:19 PM
you'll want to iterate over word probably
 
returns ""
 
not the integer
 
I want to iterate through the words list and then substitute every word that is == word with asterisks
and then return a new string with censored words
 
give example input and output
 
input: "hey hey hey", "hey"
output: "*** *** ***"
 
9:21 PM
ahhh
you can do a replace
text.replace(word, '*' * len(word))
ehh
yea
t
gtg, good luck!
 
Did it
def censor(text, word):
    words = text.split(' ')
    for w in range(len(words)):
        if words[w] == word:
            words[w] = "*" * len(word)
    return ' '.join(words)
The split was wrong
 
grats, always good to do it on your own :)
 
thanks for the support
 
note in this case you can just do
text.replace(word, '*' * len(word))
 
its going to replace all
or just the first?
 
 
2 hours later…

« first day (1646 days earlier)      last day (3296 days later) »