« first day (2773 days earlier)      last day (2401 days later) » 
01:00 - 22:0022:00 - 00:00

01:00
@wim Does this satisfy you, you crusty old badger?
wim
wim
01:27
It's better but not best
Everything after and including the word "output" is not adding any value and/or irrelevant to the question and could be removed (why are you talking about "import as" aliasing here??)
cbg
01:43
0/
@wim I always include the output of code I post to demonstrate that the code performs as intended. I talk about "import as" aliasing because I wanted to explain its advantages over the from mymodule import method1, method2 that the OP wants to use.
@Mulliganaceous When you do improve that linked list question, it may help to add . I won't add that tag now, since that will needlessly bump the question.
wim
wim
02:36
@PM2Ring there is only 1 method here so any "advantage" is opinion based at best. sometimes it's good to include output, but in this case the output is not interesting-it's a forgone conclusion.
@wim According to the question & comments the OP's real code will contain several methods.
DSM
DSM
.. are we still talking about this? Like global thermonuclear war, it's a strange game..
@DSM I decided to partially follow Wim's advice, and just updated my answer a little while ago.
03:16
There are some amusing answers on this HNQ apple.stackexchange.com/questions/325359/…
 
2 hours later…
04:49
@abarnert I guess we'll never get to the bottom of the Mystery of the Malformed JSON. ;)
It seems I spoke a moment too soon. Still, I feel a bit weird answering a question about broken hand-made data. I guess it's kind of a typo question. I'm happy to delete my answer and VTC. stackoverflow.com/questions/50431585/…
05:14
Was this question really that bad to deserve getting downvoted and consequently deleted: stackoverflow.com/questions/50431862/…
A simple comment or two from the OP would have been enough to provide any clarifications
Really, the only right answer to "I created this garbage in notepad and it isn't valid JSON" depends on reading the OP's mind to guess what they wanted to create, then creating it for them. Which you did a pretty impressive job at, but yeah, it's not going to be helpful to anyone in the future. But I don't think you have to delete your answer; you can just VTC, and the answer won't hurt anyone.
@abarnert Ok. I guessed it was hand-made when I saw the missing quote; I figured that was pretty unlikely to be a C&P error.
Yeah, but you also had to guess that he wanted a flat dict as opposed to a list of dicts or dict of dicts when what he wrote was sort of a set of dicts.
Well, it's a dict of dicts. Which is relatively sane. What really annoys me is JSON consisting of a list of single item dicts, all with the same key.
05:26
Yes, but a list of single-item dicts with keys spam0, spam1, spam2, … is even worse. Because eventually they're going to ask "Why does it say spam2 > spam11?" Then "How do I create 14 variables in order?" And progressively worse questions from there.
why are people so downvote-trigger-happy on questions
obviously the OP has some misunderstanding which is why they are asking the question. but if they've clearly formulated the question properly, idk why people downvote just because it seems obvious to them
@sshashank124 because there is no penalty and newbs gotta learn
just kidding though...
i'm not sure if you're being sarcastic or serious
oh ok lol
@PM2Ring MacKeeper brings up bad memories. The company we sold TuneUp Media to back in 2014 had just bought MacKeeper and a dozen other programs, and it soon turned out that what they were interested in our software and the other useful stuff for was "Buy XXX for 20% off and get MacKeeper for free!" so they could trick more people into installing MacKeeper and its adware.
05:34
There are good questions and bad questions
this question got -2 for no reason
lemme see
and even a close request
@abarnert That's evil. :(
obviously, for us it might seem like it's an obvious mistake. but there is absolutely nothing wrong with the question and even properly formulated
05:35
@sshashank124 I agree in that I don't agree with the downvotes
Not everyone thinks the same
3 downvotes now and a close request
same for this question from earlier: stackoverflow.com/questions/50431862/…
just slightly unclear by the OP but could easily be resolved by a few questions/updates
You can make a comment and try to edit to make more clear. Fight the good fight. Make an attempt to instill civility. Just don't be surprised when people don't agree with your sentiment because then inevitably will disagree.
yeah i'll do that
And you'd be surprised that you may even be persuaded. But you'll never know unless you start the conversation
@PM2Ring It was sad seeing something I'd worked on for four years being used that way. Probably my least satisfying startup exit. Despite being the only actually profitable one.
05:41
@abarnert is that an unintentional sell out?
@piRSquared The investors shut down the company. So the original founder (who they'd ousted) got a group of four of us together to buy the assets from receivership, relaunch it, strip it down so it could run profitably, and then sell it off. We just didn't realize the highest bid was from a scam company.
@sshashank124 My guess is that it got downvotes for insufficient research by people who didn't read the question properly, or who didn't fully understand it. They see someone trying to access values from a dict via attribute access, so they think "dict doesn't work like that, and the OP would know that if they read the docs".
unfortunate
Actually, from what I understand, the company we sold to weren't evil themselves, they were just marks that the MacKeeper/Zeobit guys were using during that year when they sold off MacKeeper and then bought it back under a new name. The whole history of MacKeeper is hard to keep straight.
@sshashank124 I added a link to an old question that show various ways to make a dict that allows access via attribute, and the various pros and cons of doing that.
Oh, ok. I've never heard of MacKeeper before, but I'm not a Mac user, so I don't keep track of stuff like that
user5777975
05:59
hi all python coders
@sshashank124 Agreed. Still, the OP didn't say what he was expecting the code to do, and I guess it looks like he didn't read the docs. But it is quite common for questions to be unclear because the OP has some incorrect belief in what the code should do, but they never explicit state what they expect the code to do, and it can be hard to extract that information from them.
@kvmahesh "all python coders" may not be accurate. I feel better with "some python coders"
Hi all, I'm looking for some help using wincertstore package to pass Windows default certificates while using Requests
@piRSquared Sure, because any formula in Sigma-0-1(Python coders) is recursively enumerable.
@adimessi30 You might get more help during the week, the room's pretty quiet on weekends. And most of the people currently lurking here don't use Windows.
06:09
@adimessi30 I don't know the wincertstore package, but… don't people usually solve this by just using an SSLContext from Python's builtin ssl module, which already knows how to read from the Windows cert store?
Possible bug in the zipfile module? A command-line tool can open the archive, but trying to read it using zipfile in 2.7 raises BadZipfile. stackoverflow.com/questions/50431803/…
I haven't dealt with this since long before Windows 10 and Python 3.6, so that could be completely out of date…
06:23
@PM2Ring I doubt it's a bug in zipfile. Just because one zip tool can handle a file doesn't mean it's a valid archive.
OK, lets stop second-guessing here. You've got Mac; please execute file my-files.zip and copy the output thereof into the question itself. — Antti Haapala 33 secs ago
@abarnert Fair enough. Some decompression tools ignore extraneous data, some treat it as an error. FWIW, most JPEG readers I've encountered ignore trailing bytes, which can be "handy", but I guess it could be exploited for nefarious purposes.
@AnttiHaapala Good thinking.
more findings. gzip the executable is able to extract zip files with one member, but gzip the module isn't.
OSError: Not a gzipped file (b'PK')
> Files created by zip can be uncompressed by gzip only if they have a single member compressed with the 'deflation' method. This feature is only intended to help conversion of tar.zip files tothe tar.gz format.
cbg-morning all
so just FYI that asking "does it work in gzip" doesn't mean that it is a gzip file :D
06:37
@piRSquared just checked your answer on SO. Panda-Fu at its best!
lol
@AnttiHaapala I almost mentioned that in my 1st comment, but I didn't want to confuse things. :)
@PM2Ring that's fair. and thanks for the link
No worries. FWIW, I was playing with that stuff a while ago, but I used a UserDict rather than plain dict. I'm still not comfortable deriving from the built-in types, since that was impossible in the old days. :)
i personally find composition better than inheritance when dealing with built-in types
but that's just an odd preference
"Python 2.2, originally released on December 21, 2001."
@PM2Ring are you sure you actually did it before 2001 or you just were browsing docs some time after 2001 and found UserDict
06:53
Hey, it's taking me a while to get used to these fancy new-style classes. :D
@AndyK thx (-:
@piRSquared welcome mate.
@sshashank124 I generally prefer composition over inheritance for just about everything. But I like to mess around with inheritance from time to time, just so I don't forget how it works. :)
well, at least the 2.2 docs spell it out rather nicely: "Note: This module is available for backward compatibility only. If you are writing code that does not need to work with versions of Python earlier than Python 2.2, please consider subclassing directly from the built-in dict type."
06:55
so it might be that you were doing that with 2.2 even but were uncomfortable about breaking backwards compatibility.
@sshashank124 and just as PM2Ring said. The inheritance is the most idiotic thing ever invented for OOP.
:( i like it
stop liking it.
people abuse it. but it's good if it's done properly
One of my earliest Python programs subclassed list. It took me a long time to make it work properly. Some of the pain still lingers.
06:58
i do agree tho. i really like the way haskell handles it with Traits
and even interfaces are really nice
just extends messing everything up
And if you don't do inheritance properly, Auntie Barbara gets most upset.
the article above ^talks about Java and how you should do "interface inheritance, not implementation interface"
in Python you do interface inheritance by duck-typing
if only everyone coded super-carefully, C is the best lang to ever exist
Q.E.D.
blah, I go to dmr home pages... they're now on the web server that belongs to Nokia Bell Labs. Who'd have thunk :P
@sshashank124 If you're actually good enough and careful enough to use C properly, Rust will be easy for you, and if Rust isn't easy for you, you were only fooling yourself that you were good enough and careful enough to use C properly.
07:11
i actually spent quite a bit of time learning rust and really enjoyed it
Anyway, inheritance works just fine in the Smalltalk/Python/Ruby model. It's only the semi-static C++/Java/etc. model that makes everything non-trivial ueeless.
but fell off because without a context to apply it, i wasn't able to exercise the lang
but i really like both C and rust
@abarnert incorrect-o :D
Rust is a pretty good language for writing Python bindings around C libraries.
the semi-static thingie is just one part of it, the fragile base class thing still remains in Smalltalk/Python/Ruby
I should get into Rust.
07:14
@abarnert you're making me want to get into rust again
Fragile base classes are rarely a problem unless you're thinking of a class as a "struct with methods". Which, in Smalltalk or Python, you really shouldn't be.
i actually have something i could apply it in this time, would be fun
@abarnert well, in your class you need to be super careful to not have a member by the same name as the future version of the base class :D
i feel like it should be either no inheritance and purely interfaces, or all the way inheritance including multiple inheritance
i don't like the java half-ass
@AnttiHaapala In theory that's a problem; in practice, it almost never comes up. And on the rare occasions where you're doing somewhere where it might come up, __ is usually the answer.
07:18
@AnttiHaapala good read
@sshashank124 Yes, but trying to do multiple inheritance with semi-static classes is how you get C++, or at best D.
which is why i would prefer just not having inheritance at all in the first place
but if you HAVE to, i prefer C++ over Java
<trigger-word>
as I've said, there are 2 kinds of people: those who don't understand C++, and Bjarne Stroustrup.
But I prefer Python way, way over C++ and Java. It does multiple inheritance properly. In a way that lets you do mixins, traits, interface inheritance, etc. without needing separate language features for each of them (unlike, say, Sather or D).
@AnttiHaapala Unless you're talking about pre-ANSI C++, there are two people who understand the language: Andrei Alexandrescu, who hates it, and Herb Sutter, who's paid to not hate it.
haha except that multiple inheritance doesn't work if you want to have constructors that take arguments
:P
07:21
i still maintain haskell has the best features for this. if only it would leave unicorn-land
@AnttiHaapala Constructors work in a cooperative class graph.
The problem is people trying to apply inheritance to problems where it doesn't make sense, and then complaining that their design that doesn't make sense can't be turned into code. For almost anything except GUI widgets, simulations, and things that obviously map to one of the two, there's rarely a reason for an inheritance hierarchy depth more than 2.
Inheriting a mess of interfaces and a mess of mixins works fine. It's only when you start thinking, "Hey, my mixins should be a parallel tree to my interfaces" that it falls apart. But you don't get anything out of that, and it doesn't make sense, so there's no reason it should work.
07:54
@abarnert Could you share an example.... I could probably try it out and implement it in my program.......
@adimessi30 I don't have one lying around, and I don't have a Windows box here to test on. But I'm sure there must be one on SO. It would look something like this:
class SSLContextAdapter(requests.HTTPAdapter):
    def init_poolmanager(self, *args, **kwargs):
        context = urllib3.util.create_urllib3_context()
        context.load_default_certs()
        return super().init_poolmanager(*args, ssl_context=ssl_context **kwargs)
@AnttiHaapala lol
@abarnert I have actually tried this, it threw an error saying context had no module named load_default_certs()...... Any idea why?
I'm just going on vague memories here. I'm pretty sure something in urllib3 has a load_default_certs method, and that's the method that loads the OS's cert store, but all I could find from a quick search was this.
@abarnert ok I'll check it out and get back to you
08:17
then stackoverflow.com/questions/19823414/… 5 year old typo with 16k views
08:48
@Aran-Fey Ok, it's closed now, but I don't see a delete button.
Huh. Is there some criteria that must be fulfilled for a question to be deletable?
Ah, it has to have been closed for 48 hours :/
@Aran-Fey Maybe that applies if it has an upvoted &/or accepted answer. I've delete-voted stuff that was less than 10 minutes old.
It's "closed for 48 hours" or "score <= -3". meta.stackexchange.com/a/5222/360842
09:30
@AndrasDeak «"big box down the bottom" is topologically equivalent to a nonexistent box» Confirmed: stackoverflow.com/questions/50433278/…
09:40
@sshashank124 You may find this link useful: Why may I not upload images of code on SO when asking a question?
@SeanFrancisN.Ballais It's probably a Good Idea to restrict the use of "kevin'd" to this room. The general readers on the main site won't know what the yam you're talking about. :)
@PM2Ring, in relation to [this[(stackoverflow.com/a/50433478/1116098), why do remainders have the same sign as the divisor in Python?
I am just spreading the Gospel of Salad! WE MUST LET THE SAVAGES KNOW THE TRUTH! Haha
10:00
@SeanFrancisN.Ballais Yes.
My instinct is to close that question, since comparing languages like that is a bit too broad, and it seems like it's inviting discussion.
I kind of felt it to be broad but then again, it's a quality post that fits well in SO.
Interesting discussion that actually made me think!
@SeanFrancisN.Ballais I don't think it does fit well in SO. It asks about "most scripting languages" which automatically makes it very broad.
I guess it is, if you view it that way. But I think, as I see it, view it in a language design way, then it doesn't seem too broad.
Okay, you're right, as per SO definition of :too broad:

From [this](https://stackoverflow.com/questions/8634437/a-type-or-namespace-name-register-could-not-be-found)

> too broad
>
>There are either too many possible answers, or good answers would be too long for this format. >Please add details to narrow the answer set or to isolate an issue that can be answered in a few >paragraphs.
But it is an interesting question that is quite an asset for SO.
10:33
I hate the fact that our canonical question for global variables asks about "using a global variable in another function". There's no good target for questions that ask "How do I create a global variable in a function?".
This one's closed and the accepted answer is garbage. This one already knows about the global keyword and is too lengthy.
So, question: Any objections to me rephrasing Using global variables in a function other than the one that created them to "Using global variables in a function"?
@Aran-Fey I don't think Jon would write an answer like that these days. ;)
@Aran-Fey Sounds fine to me.
@PM2Ring thanks. I never even thought to check on the site itself
I'm a bit sad that none of the answers to that new question didn't advise the OP to not use globals.
@sshashank124 I have a userscript to make it easy to post some common comments. I tend to use that one a lot.
Neato. If
IIRC isn't there also a stackexchange link with common problems and replies or soemething like that
@PM2Ring yup
10:46
@sshashank124 This room has a Common Questions collection. Is that the sort of thing you mean?
Or do you mean this sort of thing: meta.stackoverflow.com/questions/368159/…
@AndrasDeak Do you think this is too broad, or closeable for some other reason? stackoverflow.com/questions/50433446/… I understand the interest, but I don't want it to hit the HNQ.
Ah yeah it was in the room itself. Thanks
BTW, we're always interested in good additions to that collection.
I'll be sure to contribute if I stumble upon any
TIL you can't change your edit summary (during the grace period) without making any changes to the post itself
@PM2Ring I think that question is fine. It's well-researched and OP is critical with sub-par answers. I'd leave it alone
@Aran-Fey but in the 5-minute grace period it will show up as 1 edit with the new message
Add a space or something
10:55
Naw, I'm gonna report this as a bug on meta
@AndrasDeak Ok.
11:19
11:32
I missed it by couple of seconds (was in the process). Edit was "improved upon", but original edit remained.
The problem is not the edit itself, but edit after closure
So in this case it's probably fine, not closed yet
@Aran-Fey way too much dev work. How about a nice sticky top nav instead?
@AndrasDeak oh, didn't realize that, was in 2 minds about it anyway.
glad to have left it alone
12:16
This dude got a perfectly valid answer deleted just because it's compatible with both python versions and it was posted twice (once on a python2 question and once on a python3 question). That doesn't seem fair.
You write bad python2-only code? Sure, go ahead and post a python3-only solution to this new question and take your rep. But if you write good cross-compatible code? Don't you dare post a valid answer!
@Aran-Fey I see what you mean. OTOH, posting the same answer to multiple questions is strongly frowned on.
It shouldn't be, if the question isn't a dupe
How do you suggest we deal with users who post the same answer to 4-5 questions that aren't duplicates?
Personally, I'd ask them for an autograph. If they can write an answer that answers 4 different questions, they have my respect
"Use an HTML parser"
12:31
Why do you need to "deal" with that? If it answers the question, leave it alone. If it's good, upvote it. If it's bad, downvote it. But don't delete it if it's a valid answer.
117
Q: Is it acceptable to add a duplicate answer to several questions?

Won'tLet's say there is a user who has found a satisfactory answer to a common question asked on Stack Overflow (or other Stack Exchange website). This answer may be a snippet of code, or an addon, or a framework, or something else. Is it acceptable for this user to formulate an answer for one que...

Are the questions duplicates of each other? Nope.
Are they promotional in any way? Nope.
Could the answers be more specific to each question? Doesn't matter. The answer is valid; specific or not.
Are the questions asking about the wrong thing? Nope.
13:18
Will a thread running at 100% impact the performance of anything else? Assuming you use less threads than available.
13:29
@JohanSundman Are you talking about a normal Python thread from the threading module?
@PM2Ring Yes, I'm running 3 threads on my raspberry pi 3 model B which has a quad core processor. I assume that the SSH connection is also using some processing power which is why it's periodically freezing.
But shouldn't that last core be accessible for the ssh?
@JohanSundman Sorry, but all of those threads are running on the one core.
@PM2Ring That explains alot then.. How do I utilize the other cores?
See multiprocessing. Sorry, I don't have any specific advice.
@PM2Ring omg... That's a horrible answer... Can't even delete it as it's accepted
13:41
@JonClements I had a feeling you'd be displeased at the sight of that one. :) You can edit it…
He was more than helpful
A quick google search and I know which module to use
@JohanSundman Jon's talking about an ancient answer he wrote.
Not sure I can spend enough time in the editor without gagging to edit it :)
Oh no I didn't even see your link
13:44
Hey @JohanSundman - I know PM2 is remarkably helpful :)
why aren't threads executed in parallel?
@Aran-Fey With you on this one
@JohanSundman It's a long story. Remember multicore wasn't a thing when Python was first devised, and one of its design decision (the Global Interpreter Lock or GIL) isn't consist with parallel execution of threads.
@abarnert I have gone through different approaches from all the below links:
13:53
@sshashank124 You know you can edit duplicate lists, right? You could've removed your dupe and added NPE's instead of reopening the question
@abarnert But I still could not manage to get it to connect. I also tried your approach of using class SLLContextAdapter
`from requests.adapters import HTTPAdapter
from requests.packages.urllib3.util.ssl_ import create_urllib3_context

class SSLContextAdapter(HTTPAdapter):
def init_poolmanager(self, *args, **kwargs):
context = create_urllib3_context()
kwargs['ssl_context'] = context
context.load_default_certs() # this loads the OS defaults on Windows
return super(SSLContextAdapter, self).init_poolmanager(*args, **kwargs)
14:10
@Aran-Fey i wasn't able to figure it out. how do i do that?
oh i see it
up top
the big fat annoying edit button, yeah
@Aran-Fey thanks, i completely missed that. haha
@vaultah if the exact same answer: flag. These usually get deleted.
~exact
cbg! Popped by in order to ping people about my new meta post relating to chat.
@AndrasDeak yeah, I actually agree with that policy :P
That must be a duplicate
14:17
@vaultah From that SE Meta link I had a feeling you might. :)
@vaultah good find! I couldn't find it for some reason - SO search is awful
@AndrasDeak But why?
Reopen vote please - question edited after it was closed: stackoverflow.com/q/50430246/2823755
Their code doesn't match the error
And there're too many issues with that code, and the answer is ugh
Pass
@Aran-Fey they usually get deleted with "if it's a dupe don't answer; if it's not a dupe tailor your answer to the question"
@wwii The cause of their error message is a typo: using a comma for a decimal point. So we'd just be re-closing it anyway.
ok
I was about to post a comment anyway but you beat me to it
15:18
@AndrasDeak If the answer isn't tailored to the question, you can downvote it. If it really is too vague to be an answer, then sure, flag it as NAA or whatever. But all of that is completely unrelated to the answer being a copy/paste. "Has this answer been created by pressing CTRL+V?" is not something you should consider when voting or flagging
@Aran-Fey consensus and mods disagree with you
If it's a crap answer NAA doesn't apply
I just want to hear one argument for deleting copy/paste answers. Just one.
@Aran-Fey I'm just the messenger :D though most things I see in this regard are all crap answers
15:34
PLease help me with this ! - stackoverflow.com/questions/50434784/…
Histogram in python
@Unknown please don't post new questions here as per the room rules
@vaultah I see, thanks. Meh
@AndrasDeak : Okay :-(
@AndrasDeak The closest thing to an argument I've seen so far is "identical answers are bad because you should adapt your answer to the question". And somehow they equate that with "the answer shouldn't be posted at all or should be deleted", as if all slightly suboptimal answers deserve deletion.
15:46
@Aran-Fey FWIW I don't think this is/should be a hard rule
Then again your guy can post to the python question, and leave a link in a comment on the pythoff question
I'm sure lazy rep fishing is a strong motivator for the consensus
sunday morning cabbage
You probably have a point there, but IMO the priorities are backwards there. Deleting a valid answer just because it's easily earned rep is stoopid. I say let them have their easy rep as long as it's a valid answer. If we want to do something about lazy rep fishing, we shouldn't give people rep for answering duplicates or typos.
Those have feature-requests of their own :)
My biggest objection to copy-paste answers is they are often plagiarized.
Well, plagiarism is okay if it's your own work you're copying :P
16:00
yah, I'll give you that. The ones I have seen have been copy of someone else's work, though.
It actually blows my mind that people do that. Copy/paste another person's answer, I mean. I wouldn't believe it if I hadn't seen it for myself.
user7986928
Good evening..
The other important issue, which is mentioned in the SE.Meta post, is that these dupe answers have been used to promote the author's library, which is linked in the answer, making it a form of spam. Even if it's a free software, they may be earning revenue from page hits, but even if that's not the case the page hits can boost their page's visibility to search engines.
@Aran-Fey actually self-plagiarism is a thing in academia
user7986928
May I ask. Does anyone here knows some journal on math or algorithms but for 'beginners'? Or perhaps 'soft' or 'recreational' are more appropriate. Thanks cabbage.
16:10
@Aran-Fey Often those answers aren't from SO. This is a common technique for trying to boost rep quickly. The mods see a lot of it, and it would slow them down if they had to carefully judge every dupe answer to see if it was done in good faith or if it's a dodgy one. So it makes life easier for them to have the heavy-handed "no dupe answers" policy.
Verbatim copying half your master's thesis into your doctoral dissertation won't fly
@PM2Ring Yeah, I've seen that once. There was a user who answered questions with tangentially related blobs of text stolen from blog posts or the like. It might even have been a bot.
user7986928
2nd question. Does anyone has/knows a project on github where a person can contribute with skills on algorithmic problem solving, in Python, with minimum knowledge of other tools/softwares.
that would be the golden question
16:28
I'm procrastinating on studying something by looking at possible contributions to CPython. Anyone got any nits to pick regarding docs or lib (or whatever)?
Yes! Can you do something about the inconsistent naming in the builtins and stdlib? Like how int.from_bytes uses snake case but str.isprintable or sys.setrecursionlimit don't.
Shouldn't take longer than 10 minutes :P
And most of the methods in the ast module aren't properly documented. For example, does ast.fix_missing_locations return a new node or modify the node in-place?
@AaronHall You could fix this, which used to work in Python 2, but doesn't work in 3 because you can't compare ints & strings, and .dump does the sort before it converts all the keys to strings.
import json
d = {1:'a', 2:'b', 'default': 'z'}
print(json.dumps(d, sort_keys=True))
@Aran-Fey no - that will not happen.
@Aran-Fey that might be doable...
16:38
:D
@PM2Ring I'll look for a pre-existing bug report...
@AaronHall One was filed quite a while ago. I guess it might've been fixed recently. The latest I have is 3.6.0
@Code-Apprentice Hammered :)
@PM2Ring I would imagine that since dicts are now sortable, they would probably say "sort_keys is redundant" - and prefer to not fix.
16:46
@AaronHall Perhaps.
user7986928
Nope..?
@Code-Apprentice Neither of the suggested dupes mention str.casefold, which is the preferred modern method for caseless matching.
@Arief Sorry. It's a good question, but I don't have any good suggestions. Also, you need to put some bounds on "beginner".
I usually contribute to CPython by finding old unresolved bugs, submitting pull requests, and then refreshing the page/checking email in hopes of getting a response every day for the next month
Then I give up
It's fun, try it
@AaronHall Thanks. Yes, I've seen that before, apart from the last entry by zachrahan, and your new one.
rhubarb
16:55
@vaultah I have had a bit of success. My 3rd PR is nearly in and my prior 2 have got in. But this is the most code I've submitted so far, even if it is all (95%) tests.
But I've also met quite a few of the core developers and gotten advice.
wim
wim
Chance of getting a CPython PR looked at and merged increases dramatically by going to CPython sprint at PyCon and doing it in person
17:25
@adimessi30 Sorry; if that didn't work, that's all I have; that's what I remember doing a few years ago, and if it no longer works (or if I'm remembering wrong), I don't know how people solve it. And the wincertstore library you were trying to use a backport of code that's already added in Python 3.4, so if 3.6 isn't working, it won't help.
@PM2Ring TIL
already gone
wim
wim
@DSM I don't understand your war analogy? (though I haven't seen the film)
As long as PM2 wants to ask my opinion, I'm happy to provide it. It was my understanding that talking about Q&A is on-topic in this chat room :P
DSM
DSM
@wim: "Strange game. The only winning move is not to play." <- re: trying to modify an answer to please certain people :-P
wim
wim
18:00
yesterday, by wim
you can't please everyone
@Aran-Fey So are you saying the AST docs in general need improving, or just that function?
@abarnert would you happen to know if I can use wget to get the page content without downloading it.... Inside python
@DSM The only stakeholders I don't worry about pleasing are those who wish my answers were shorter and those who, after careful consideration, I conclude are wrong... :P - otherwise, I think I at least keep everyone somewhat gruntled.
@AaronHall The docs are generally fine; my only complaint is that it's unclear if some of the functions modify the node in-place or return a new node (or both). The offenders are fix_missing_locations, and increment_lineno.
ok, I'll search for a relevant bug report.
18:15
yesterday, by wim
"too verbose" is legitimate downvote reason, as are "I was having a bad day" and "my cat walked on the keyboard".
@PM2Ring Yes, and I would emphasize the difference in semantics between a complaint that an answer is "too long" and that it's "overly verbose". I hope no one finds my answers the latter.
I certainly don't labor under the misconception that I'm paid by the word.
If I did, I'd attend far more to my blog.
wim
wim
too long != too verbose
sometimes answer needs to be long, no problem. taking 1000 words to explain something that can be explained equally well in 100 words, problem.
@adimessi30 I don't know what it means to get the page content without downloading it. Download is just a fancy word for get the content.
wim
wim
maybe he is asking about HEAD request
content-length metadata etc
opinions on closing this as dupe of this?
Ignacio's answer may have been correct all those years ago, but it's less than useless now..
@wim go for it
wim
wim
gyneh CPython's makefile is too hard to read
@AaronHall Most of my more recent Python/CPython PRs have died, only to be reimplemented by someone else in the next version, which is good enough for me. Even big stuff, like changing the bytecode to "wordcode".
@Arief There used to be a Journal of Recreational Mathematics, but I think it died shortly after Martin Gardner did (not directly related, just that they're tied in my memory for reasons that should be obvious), with one special issue a year or two later.
You can probably find interesting stuff to learn just by browsing math.SE (not mathoverflow) and cs.SE and following links from interesting questions.
wim
wim
he died? thought he was just on Gardening leave..
18:41
@abarnert oh ok.... To make it clear.... I'm scraping part of the webpage to perform checks on the content..... Does that help??
@adimessi30 Not really. How could you scrape part of the webpage without downloading that part of the webpage? And how could know what part of the webpage to download without downloading the whole thing, or at least doing a streaming download and breaking after you find the part you're looking for?
@abarnert ok my mistake.... What I meant to say was I do not want to store the webpage to a file I only need the HTML content to be passed on to my python funcion so that I can use the required documents tags
@wim I had actually thought he died earlier. His original "retirement" didn't slow him down at all, but his second retirement around 2000 did. He went from a new book every 9 months to spending 10 years working on an autobiography that was only published posthumously (and a couple new editions of old books).
@adimessi30 Sure. Just about every HTML library makes that easy. For example, with requests, just access the text (if you want it to decode using the specified encoding) or content (if you want raw binary data) property, and it'll download it in memory without storing it to disk.
So that's the strange part..... The same url is being denied access when I use requests.... Whereas wget fetches me the webpage as a file.....
Which is why my previous question was on how I can use Windows certificates to validate my request
Bad certs won't cause a 403 Forbidden or other access-denied. If the client can't validate the server's identity, the client refuses to connect. If you tell it to connect anyway, the server won't complain. If you're sending the same query string or form or whatever, and not sending any extra headers that might contain a token or similar, the difference could still be referer, cookies, or even user-agent.
I think you need a MCVE to debug this, and probably a question on the main site.
18:55
MCVE ??
On the wget front I am able to use the no check certificate and pass my user credentials
While on the requests front, I have tried doing the same with httpauth and verify = false.... But couldn't get it to work
MCVE = Minimal, Complete, Verifiable Example. As in: show us the exact wget command and requests code and the exact error, rather than just describing them. Which, for something non-trivial, fits better in an SO question than an SO chat convo.
Can I share you my question which I have already created
1
Q: Python Requests with wincertstore

adimessi30I'm trying to connect to my corporate's internal webpages through the requests package, but since python does not use the windows default trusted certificates the connection is denied. I found out that wincertstore can be used to fetch the windows default certificates. But I'm still not sure how ...

19:11
@adimessi30 please read the rules
@adimessi30 your question needs to be older than 48h to post it here. Check the python room rules -> If your question is eligible for a bounty (>= 48 hours old) and hasn't received a useful response, then you may link to it.
Your question doesn't include the wget command, it doesn't even mention much less show the "denied access" error you mentioned here, and it doesn't include any of the details you've given here to questions I and others have asked. All of that needs to go into your question, or it won't be answerable by any of the hundreds of answerers who haven't been involved in your chat conversations.
And that includes most of our best Windows and SSL experts, who are the people you probably most want help from.
@AndyK understood..... Will refrain from doing so.....
@abarnert I shall add all the necessary details into my question.... Thanks for your help
@adimessi30 just nudging you matey. I'm only one of the denizen here but some of the mods can be more ... expeditive in their dealing with newcomers and their understanding of the rules. And tbh, we like newcomers to stay. ;)
@AndyK ok 🙂
19:25
If something starts off in chat, and someone suggests you post it on the main site, I honestly have no idea whether the 48 hour rule then comes into play for that new question. But I'd err on the side of safety—if people are still discussing the question, keep answering them, but if not, wait for people to read the question and try again in a couple days. (Or maybe ask a mod instead of guessing; seems smarter now that I think of it…)
We do allow linking recent questions if they originated from chat
 
1 hour later…
21:02
@MartijnPieters I'm still waiting for your ok regarding my suggested edit of this question. The paste has expired, so here's a new upload of the question and your answer
@Aran-Fey I thought I already okayed it?
or rather, I thought the plan was to keep the question mostly the same, with my answer unchanged.
I don't think so. I gave you two versions to review, and you said you didn't have time to read the 2nd one
If your answer is to stay unchanged then I can't get rid of the Cage class. It wouldn't be much of an improvement, really
I did keep the nested function, so the changes are mostly limited to the code in your answer
21:26
recbg
21:55
cbg
cbg
at the office on a sunday
fun fun
01:00 - 22:0022:00 - 00:00

« first day (2773 days earlier)      last day (2401 days later) »