« first day (2660 days earlier)      last day (2513 days later) » 

00:04
Recbg
00:23
@davidism There's literally nothing you can do to handle bad decorators. A bad decorator is indistinguishable from a normal function. There are surprisingly many pitfalls, but I have a pretty decent implementation + test cases here
All of this just because python uses the same few exceptions for everything ¯\_(ツ)_/¯
 
1 hour later…
01:38
@jp_data_analysis You used Ajax's one? No wonder then :-P. That kid... incredibly frustrating. Consistently posts the most terrible stuff, pisses me off all the time. — Stefan Pochmann 4 hours ago
Hmm
Is this flag-worthy?
Also, cbg folks
Even I think that's a pretty rude comment, so it probably is
Okay, fair enough
You know, sometimes I wish my english was fluent enough to let me compose 2 sentences without having to think about grammar and phrasing for 5 minutes. Even if it's 3AM.
@AndrasDeak Just because it's true doesn't mean isn't necessarily rude.
01:53
Anyway: That comment isn't horrible, but I don't think anyone will bat an eye if it's flagged. Also, I'm going to bed for real now.
@Rawing your English is more than fine, dude
+1 I've never had problems understanding you :)
@cᴏʟᴅsᴘᴇᴇᴅ I know. Still meh. The only possible rude part is "posts the most terrible stuff", the rest says more about Stefan himself than his opinion on Ajax
@Rawing you could easily pass as a native as far as I can tell
Yes, and I share his sentiment. Really posts some poor stuff as long as it fits in one line, rarely explains his answers, with a mere "try this". I've tried reaching out to them... but the fgitwing continues
Sure, I don't have a problem communicating in english. It's just that sometimes I struggle a lot to find a way to express myself accurately. I can literally spend 10 minutes staring at my keyboard without being able to write a full sentence.
01:56
It just took me a minute to tell my wife where I put one of the dog's bowls, and this was in my native language. So perhaps it's more 3 AM, less English skills ;)
I see huge variance in my fluence in English based on how much and how well I had slept beforehand. When I'm sleep-deprived for a few days and tired (just like now) I find it significantly harder to express myself in English than in my best form
the same way that you should take the minimum of timing tests, you should take the maximum of your English skills, because that's what has the least overhead
Since my ability to express everything I want to say is declining rapidly, I'm gonna keep this short: Thanks for the positive feedback, and rhubarb :)
02:18
rhubarb, sleeptime for me too
We have a guest.
rbrb to you too
user3736406
Im having a big issue installing a pip package, I do pip install python-binance and I later get an error saying: cl.exe exited with error status 2 or -1073741701 I've looked it up so many times and i cannot seem to find a solution. Any advice?
wim
wim
05:20
anyone from science background, could you take a look at this explanation of significant digits
Specifically, the last bullet point in the "Rules for Rounding-off a Number" description where it says "increase the nth digit by unity if its odd, otherwise leave it unchanged". Has anyone ever heard of something like that before?
They seem to be claiming that, say, 12345 rounded to 4 significant digits should be 12340. I thought it would be 12350.
 
2 hours later…
07:20
@wim Well as maths teacher, I've never seen this before (or maybe the sentence is unclear and we don't understand it?). For sure, 12345 rounded to 4 significant digits is 12350.
 
3 hours later…
10:44
@wim sounds like "round to even", used by python by default. Removes statistical bias and randomizes error
seems like the generalization of round
It's weirder with large ints but the concept should be the same
(Unless I'm missing something)
That being said, that's sure to induce a lot of frowns in most STEM areas. I only learned about round-to-even due to python
11:05
@AndrasDeak Does matlab not exhibit similar behaviour?
>>> round(12345.0,-1)
12340.0
@wim ^
@cᴏʟᴅsᴘᴇᴇᴅ nope (well, not that I know of) (I checked the docs)
11:19
Weird how python's the odd one out...
OSS is more likely to adopt, and less worried that the users might frown. If design decisions are made by Guido rather than committees and CEOs, it's easier to pick up unconventional features
there's a lot of literature if you google "round to even", and my impression is that it's only become widely known to be more precise (for certain applications?) in recent times
the entire Western culture has ".5 rounds up" baked into it from childhood
and there are several languages that use this rounding (or allow it) by default
oh, right "bankers' rounding" is the usual name
as expected it has advantages and disadvantages; I presume Guido went for "what most people will need"
 
2 hours later…
13:34
Cabbage
@Martijn Are you around by any chance?
@poke kinda sorta not really about to arrive at my station soon.
Ah, okay. When you get the time later, could you rename the tag to ?
I can't rename, only make it a synonym or merge it into another tag.
I created a new tag, added it to stackoverflow.com/questions/48455575/…
That was quick, haha
You could just copy the wiki info over, and edit those remaining 6 posts?
13:38
I will, thanks! :)
(I tried to create the tag myself, but I couldn’t, hence me asking)
13:50
Hmm...creating tags should be easy, hence all the burninations
I couldn’t create it because the c#7.1 one already existed.
Huh...
Probably because they were too similar; asked me to go on meta and request the creation of it.
So I asked Martijn *shrug* :D
Hehe :D
Now that I’ve retagged the questions, there’s just the remaining question of getting rid of the old tag… ^^"
13:58
What's the recommended way to handle test cases that fail, but you can't do anything about it? Should I comment them out? Delete them? Ideally I'd like to keep them in my test suite, but tell my unit testing framework that it doesn't have to output a massive stack trace and error message for these tests
What do you mean, you can’t do anything about it?
A short reminder "These 3 tests failed, but you knew that already" would be perfect. Does pytest have a concept like this?
@poke It's not possible to make the code work as expected because of limitations in the language/interpreter
So the test is broken.
Tests that cannot get green are broken and shouldn’t be there in the first place.
Ok, different perspective on the same problem: There are some edge cases that make my code fail. They're not important enough or too difficult to fix, but I'd like to have a reminder that my code doesn't work as expected in these scenarios. I wanted to use a "failing" unit test as my reminder, but since you say that's not the right solution, what should I use instead? A bug tracker?
Am I overcomplicating this and the correct solution is a # FIXME: this fails in scenario X? :D
Well, if you have a correct test case that highlights the problem, then yes, that should exist as a test case. Depending on your project guidelines (e.g. no failing tests on check in), you might need to do something about it. You could put it on a branch for example, so someone can pick it up later.
14:10
Hmm, a bug branch is an interesting idea
early weekend cabbage all
So I take it categorizing tests into "critical"/"important"/"not important"/etc isn't something that's usually done
cbg, Code
No, all tests are critical. If you have a test that was green get red, you introduced a regression, and that shouldn’t happen.
but some tests are more critical than others :/
@Rawing pytest has xfail for this
"expected fail"
14:22
oooh :o Thanks, I'll read up on that
I think @Rawing is talking about the code being tested and prioritizing fixes, particularly for new tests that illustrate a repro for a previously untested issue.
at least that's the way I read the recent conversation
Pretty much, yes. I want to be able to see what works and what doesn't simply by executing my test suite, without having to dig through a bug tracker or through the code looking for #FIXMEs
IntelliJ has a feature that quickly searches for all #FIXME and #TODO comments. I haven't taken full advantage of it yet, but it is nice to know that its there.
@poke synonym should handle that
14:33
I can’t create it though :P
In my experience #TODOs just get left behind and I rarely take the time to actually fix them.
whoooo! I got my tests to pass for my newest model/view in my django REST API!
well...most of them. One test still fails.
@Andras Nope, only have a score of 2 I think
Oooh. I see.
(pleb)
14:44
I think you mean "plebe"
15:01
Hi everyone :)
I was going through this code:
In [222]: class MyClass:
...: cls_var = 0 # class variable
...: def __init__(self, name):
...: self.name = name
...:
...: def increment(self, incre):
...: self.cls_var += incre
...: MyClass.cls_var += incre
...:
...: def print_var(self):
...: print("instance var", self.name, " :", self.cls_var) #Choice 1
...: print("class var: ", MyClass.cls_var) # Choice 2
...:
...:
...: obj1 = MyClass('obj1')
...: obj2 = MyClass('obj2')
...:
...: obj1.increment(5)
Needs code formatting
sorry for poor copy paste ;) how do I format it here to display nicely? :)
Link to howto in the new rules page
15:04
@kmario23 use a paste site then post a link here
room topic changed to Python: The *productive programming cabbage. Room rules: sopython.com/chatroom / How to format code [python] [python-2.x] [python-3.x]*
room topic changed to Python: The *productive programming cabbage. Room rules: sopython.com/chatroom [python] [python-2.x] [python-3.x]*
Guess not…
How so?
No markdown links in the upper right
We need a sopython.com/format-code short link or something
15:06
@all thanks for being kind :)
In [222]: class MyClass:
     ...:     cls_var = 0 # class variable
     ...:     def __init__(self, name):
     ...:         self.name = name
     ...:
     ...:     def increment(self, incre):
     ...:         self.cls_var += incre
     ...:         MyClass.cls_var += incre
     ...:
     ...:     def print_var(self):
     ...:         print("instance var", self.name, " :",  self.cls_var) #Choice 1
     ...:         print("class var: ", MyClass.cls_var) # Choice 2
     ...:
     ...:
     ...: obj1 = MyClass('obj1')
And I get the result like this:
instance var obj1 : 5
class var: 15
instance var obj2 : 15
class var: 15
It would be better to use pastebin or gist then link your code here.
Init self.cls_var to 0?
The output you have there is difficult for others to copy and paste to run themselves.
@kmario23 also, what is your question?
they probably expect obj2 to have 10
Please give me some time to format the code :) I'll ask my question then!
15:09
Clashing class and instance attribute names are probably a bad idea
@kmario23 When code has unexpected results, one of the bests ways to learn about what it is doing is by stepping through it with a debugger.
class MyClass:
    cls_var = 0 # class variable

    def __init__(self, name):
        self.name = name

    def increment(self, incre):
        self.cls_var += incre
        MyClass.cls_var += incre

    def print_var(self):
        print("instance var", self.name, " :",  self.cls_var) #Choice 1
        print("class var: ", MyClass.cls_var) # Choice 2


obj1 = MyClass('obj1')
obj2 = MyClass('obj2')

obj1.increment(5)
obj2.increment(10)

obj1.print_var()
obj2.print_var()
Isn't that the same code?
@AndrasDeak yes, but formatted correctly :)
And I get the result like:

instance var obj1 : 5
class var: 15
instance var obj2 : 15
class var: 15
The results are confusing to me! Can you please explain :)
Class variables are shared across all instances, so when you call increment you are also incrementing the shared class variable
But since you are only printing after you have incremented both objects, you don’t see the class variable actually increasing.
15:18
class Foo:
    var = 42
    def bar(self): return self.var
It was just incremented by 5 and then by 10, making it 15.
I hope Foo().bar() returns 42 ^ (I'm on mobile)
Oh, and the second instance variable is 15 although only being incremented by 10 is because before you called increment, the instance did not actually have its own cls_var instance variable. So it takes the existing value, adds 10, and then stores it in an actual instance variable that is no longer shared with other instances.
13 mins ago, by Andras Deak
Init self.cls_var to 0?
@poke Actually that's where my confusion is. I have couple of questions:

Are `self.cls_var` and `MyClass.cls_var` referring to same thing ? Does incrementing one is also reflected in the other?
15:25
Run my snippet above. If I'm right, self.var gives you access to the class attr in case an instance attr doesn't exist
self.cls_var looks up an instance variable on the instance. If it cannot find one, it will look at the class for a class variable.
Otherwise you'd get an error due to incrementing a non-existent attribute
So at the beginning, they will refer to the same. And then, after assigning self.cls_var to a new value, it’s an instance variable, so there are two different ones.
@poke thanks :) so after the first increment called on obj1, it will update only the instance variable not the class variable right?
15:32
@davidism I assume the message I got was re: what Martijn has dealt with?
@poke @AndrasDeak Thanks a lot!! That clears my doubt :)
and confusion!
@AndrasDeak I ran your snippet and that also supports my understanding :)
thanks
16:11
@JonClements You’re kind of lagging behind there. “released September 2013”
16:26
@JonClements yeah, Marijn took care of it
Although the reversal hasn't happened yet.
Not sure how that works.
CMs will handle it manually
Oh yeah, I guess they'd have to, not something that's easy to script.
I heard it can take several days
16:40
Why would calling math.degrees on a decimal point return None?
>>> math.degrees(1.0)
57.29577951308232
No repro
it's so weird, when i try it in the cli, it's fine, but when i run it it breaks
e.g. degrees(0.5280744484263596) None
How about math.degrees(0.5280744484263596) though?
@Rawing, that worked!
You probably assigned something to degrees on accident somewhere in your code
wim
wim
16:52
>>> round(12345, -1)
12340
>>> round(12335, -1)
12340
wim
wim
huh, you're right Deak. I never knew about that
17:20
hi hi
wim
wim
17:55
Yes, that looks better! Though I have no idea if apply_along_axis is correctly vectorized in numpy or not. — wim 9 secs ago
@AndrasDeak ^ is it?
I don't know but I'd be surprised
The docs claims it's faster than the python loop, so who knows
I'm always suspicious of applies
wim
wim
Check out the comments thread here stackoverflow.com/a/48473125/674039
Do you think it's just a language barrier, or do you think Divakar really has no understanding of big-O notations? I would be surprised ..
Divakar is damn smart (haven't read link yet)
Hmm, that does sound weird
I certainly don't see what he means
Implementation seems to start here github.com/numpy/numpy/blob/…
I've talked to Divakar quite a bit in the matlab room, never had any language problems
wim
wim
18:32
I know he's good, that's why I'm shocked to see this "that O would be different than an O at Python level" ... what??
 
1 hour later…
19:57
I've got a new PC : ) and I need to install my Python installation. Can someone tell me if I should get a x32 bit Python installation or an x64 version?
I went for an x32 version last time but I am not sure if there is any point to still using an older bit version. x64 sounds way cooler
I was about to ask what OS you're using, but if you have to install python... it must be Windows
Yep. The reason I'm asking is because I will be making client applications
I've had some trouble installing modules for 64bit python on Windows in the past, but it's possible that the situation has improved since then *shrug*
I think the default one they give you on python.org is still 32-bit. Go with whatever one they give you.
Yes the default is 32 bit but python.org/downloads/windows gives a whole range of 32 and 64 bit
20:04
Use the default.
OK. I'll do that then. Thank you. Whoop I'm so excited to finally have a new PC.
 
1 hour later…
21:13
recbg
21:42
cbg. Wonder what this OP is doing. Question deleted and cut in half shortly after you posted your answer...
IDK but it's gone now, or check your link
I guess you just have to go and get 10k to view it :P
cbg all
> Question deleted and cut in half
Well I can't wait for 10K then
The question isn't interesting anyway, it's the OP's behavior that's odd
21:49
privileges should be network-wide, not site specific :P
would make things much easier for me
woah, I had no idea you were a big fish on AskUbuntu O.o
/shrug
I think I'm mainly a guy who had too much time for a while...
@ByteCommander yup, AskUbuntu has some rules that I don't like. I would be happy to be able to reopen stuff there
also close stuff on IPS
and Workplace, and Academia. And don't forget Politics!
Maybe that's by design. Maybe they don't want us tech people to have any sort of power on other sites like IPS. Because they think we're socially awkward.
wim
wim
I also used to be pretty active on AskUbuntu, and quit because of too many rules and over-policing
Great way to kill a site
AskDifferent has the opposite problem, any old garbage is OK there
wim
wim
> answers that generate the brown note will not be appreciated
heheh
22:21
I'm still surprised that that post has my second highest voted answer...
But for questions it's even more weird.
22:40
will this site ever reach a plateau in questions?
it already has
is this site just waiting for the next best thing to come along so more questions could be asked?
What do you mean by the next best thing. If you mean a new programming language/framework (the introduction of Python 4 (!) ) yes we would have a surge of new interesting questions.
23:00
Yeah, it would be interesting to see how long it takes for people to run out of questions to ask when a new framework/language is released.
look at the blog
which blog?
SO blog
Which part? It's quite large.
23:13
Just as I thought then.
Cbg
Cabbage.

« first day (2660 days earlier)      last day (2513 days later) »