« first day (3020 days earlier)      last day (1946 days later) » 

9:11 PM
@coldspeed Converting comments to proper answers is perfectly fine, although the answerer should give credit to the comment writer. Complete answers don't belong in comments, but the community is divided on whether hints or answer outlines are ok in comments.
 
wim
I don't even support giving credit to the comment writer. That just gives the comment another reason to stick around beyond its welcome.
 
I think hints & outlines are fine, but some members (eg LightnessRacesInOrbit) think they're evil, mostly because they can't be downvoted.
 
I would argue it would be good form to ping the comment writer to maybe convert to an answer. Maybe a grace period would be acceptable then to then convert to an answer
 
wim
@idjaw you know pytest has caplog built-in, right?
 
But, to PM's point as well, there are valid arguments on both sides for the whole answering in the comments. Personally, I think it all matters on how concise and to the point you can be without any long convoluted code
 
9:15 PM
The only time I remember having fleshed a comment out as an answer, it was because no one else had (for ages), and I ended up CW'ing it
 
@wim I was trapped in nose for this. However, I also admittedly have not used caplog
I think I vaguely remember converting a comment to an answer, but I did it as a community post.
 
If I see a question that would be good for newbie answerers I may leave a few hints mostly to help guide the newbies & stop them writing dumb answers. In that situation I don't want to compete against the newbies... unless all the answers are bad and I need to show the OP the proper way. I'd prefer to just help the newbies to get their answers right.
 
wim
nose is deprecated btw
 
Yes I know. But, sometimes I have to pick and choose when to invest the time in refactoring.
 
wim
@coldspeed no, answering obvious dupes is.
@Kevin what's wrong with os.chdir? I use it all the time.
 
9:21 PM
If you can write a complete answer in a comment, you probably shouldn't, unless it's a typo question. If the question is that basic, it's most likely a dupe. If the question deserves an answer, write the answer as an actual answer.
 
yeah pretty much
 
I leave a lot of comments because sometimes I'm just browsing for short periods of time (say, a query is running) while I'm at work. I'm personally 100% fine with someone taking my suggestion from a comment and fleshing it out into an answer. The reason people leave comments that are indicative of the solution w/o answering is because they don't have the time to write a complete answer. At least thats true of me and those that I know who do that.
 
@AlexanderReynolds I get that. But the problem is that comments can only be upvoted, not downvoted, so you get bad info posted by people who are wrong, and haven't tested their suggestion.
But what you can sometimes do is put your suggestion in the form of a question: "Have you tried X?".
 
@PM2Ring thats fair, but you can also just call that out in the comments. Is there a way to suggest people to couch comments beforehand? I.e., "you may be able to ___", or "you should be able to do ___ but I can't check right now"? Hard to enforce, but maybe there's a way to reward this or discourage not doing so.
Yeah, we're on the same page there
 
If the comment reads like a request for clarification of what the OP has already tried, it's ok. If it's a half-baked answer that might be wrong, it's more of a liability than an asset, both to the OP & the site.
I've been mostly hanging out on Physics.SE lately. The mods there are ruthless about deleting comments that look like answers. And I guess they need to be: code is often easy to verify, physics needs a lab, or a citation of an authority.
 
9:37 PM
@MarkAmery I modestly weighed in.
 
wim
9:58 PM
anyone seen this one before? ./python: symbol lookup error: ./python: undefined symbol: __gcov_indirect_call_callee
 
Is this on a custom Python build?
 
wim
yeah
gcc 8.2.0
 
10:13 PM
Google turns up a bunch of useful-looking results. It sounds like something may be wrong with the compiler options.
 
hi guys, quick question, is it possible to store a series of items in a set() and then get them back in a for loop like this

mySet = set()
mySet.add(obj1, obj2)

for o1, o2 in mySet
 
mySet.add((obj1, obj2))
 
my_set = {obj1, obj2} :P
 
@erotavlas as long as you don't care if o1 gets obj2 in it. Sets don't maintain ordering.
 
@erotavlas: Why a set?
 
10:23 PM
i don't know it doesn't have to be a set...hold on I'll post my full code
 
@AndrasDeak even if we ignore the obvious NameError, the tuple unpacking in the for loop statement would fail
 
20% chance answer: set.union(*list_of_sets)
@vaultah oh, I see what you mean. I kind of missed the whole for loop part
 
The way you've posed this question suggests that you don't really want the behavior of a set.
 
seen = set()
seenEntities = set()
for s in top10sentences:
    response = client.analyze(s)
    entities = list(response.entities())
    entities.sort(key=lambda x: x.relevance_score, reverse=True)
    for entity in entities:
        if entity.id not in seen:
            print(entity.id, entity.matched_positions)
            seen.add(entity.id)
            seenEntities.add((entity, s)
 
Where is the unpacking loop?
 
10:25 PM
for entity, sent in seenEntities:
    print(sent, entity.matched_text)
 
wim
Jan 15 at 20:59, by roganjosh
camel-case. Gross.
 
that?
 
You're missing a closing parenthesis on seenEntities.add((entity, s).
 
ok, but you said order is not preserved? so I can't read them back in the for loop as entity, sent?
 
I'm out ;)
 
wim
10:27 PM
@user2357112 nothing much fancy in my options ./configure --enable-optimizations --with-ensurepip=install --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"
 
--enable-optimizations and --enable-shared is a combination at least one other person has had problems with: bugs.python.org/issue29712
 
The order is not preserved if you just put two items in and then tuple-unpacked them out. But if the set contents themselves are tuples, then you can do the for loop much as you have written, because tuples dopreserve order. You just wont get back the tuples in the order you added them.
 
and the brackets around the items makes it a tuple?
 
For your seen entities, a list of tuples should be sufficient, since you are doing the uniqueness checking on entity.id in seen
 
Jan 14 at 18:20, by Andras Deak
The two aren't exactly similar qualities, but OK. In that case you might want to read a tutorial to brush up on the basics.
 
no, this is not the first time we're having a conversation like this
 
dont worry , looked it up already
thanks guys, code works
 
That page is broken, I just see a bunch of empty boxes
 
wim
looking forward to "\N{Man With Probing Cane}"
finally \N{Garlic}
 
10:44 PM
ooooh
 

« first day (3020 days earlier)      last day (1946 days later) »