« first day (3572 days earlier)      last day (1369 days later) » 

6:40 AM
If I want to get hands on with async what is the way to start? Like I was told to thread in GUI apps so blocking of UI does not happen, what can I do to understand async? or is that an advanced topic for which I must understand something else?
cbg btw :)
 
what math do i need to know for tensorflow
 
I have used it for some basic image classification problems and I didnt have to use math at all there
 
(*´∀`)_旦
have some tea
 
6:58 AM
How is that tea?
A Unicode table just coughed on the screen.
 
@CodyGray you'll have to let your imagination run wild a bit to see it
Btw, how are your new teammates?
 
I like them! Don't you?
 
indeed, I did vote em in after all
waiting for my #3 to be voted in now ... waiting
 
I think we made the best possible decision.
 
Someone mentioned Yvette and Machavity won initially, was that before discounting her votes?
or was that just a hoax?
 
7:06 AM
Definitely a hoax
The only way the election was ever run was by discarding Yvette's votes and rearranging people's choices, as STV does.
I believe people also downloaded the raw vote data and ran the numbers, finding that the outcome would have been the same even without discarding votes for Yvette. But that's kinda meaningless, since plenty of people had time to change their votes for Yvette after she withdrew. So speculating about who would have won if the situation was different is... silly.
 
Yeah, makes sense
 
7:21 AM
@python_learner The async ecosystem hasn't really stabilised yet, so digging too deep into any specific lib/framework isn't worth it unless you really need it. For a general understanding, How does asyncio actually work? will give you the background to avoid various gotchas (e.g. why blocking on GUI is bad with async). ...
... For understanding async design, Go statement considered harmful is a very good read.
 
Overuse of "considered harmful" titles considered harmful: a treatise on the advantages of original thought
 
It makes sense in the context, namely making a bad pun.
should have picked the other title, perhaps. Can't edit anymore now. :/
 
8:06 AM
@MisterMiyagi will look into those, thanks :)
 
8:36 AM
Does anyone know a general tool-box for fine-grained deprecations? I've found the deprecation package, but it seems to handle only functions/classes.
I'm looking for stuff like deprecating keys of a format input, enum members or value ranges.
 
 
4 hours later…
1:05 PM
Goodness I really wish there is an answer flag for unsafe software practice - see stackoverflow.com/a/63115775
 
It looks like \/
 
yeah, already done so, but sometimes I still really wish there was something stronger
 
Yeah, but it would probably also be abused a lot
 
I supposed so, come to think of it the actual moderators have enough on their plates already... oh well, comment downvote it is.
 
And specifically the mods never have to judge technicality, but you probably already know that
 
1:17 PM
Cbg all
 
@metatoaster "eval() on the other hand is safe" is now worse :|
 
Isn't eval capable of calling exec?
 
That's what the answerer said, I commented eval is still not safe.
 
@Phantom_ what math and how much varies massively based on what you are using it for
 
They're having a 'mare with the revelations there :P
 
1:20 PM
@metatoaster facepalm
 
@roganjosh horsing around?
 
That answer is like: "It hurts when I try to take a pan out of the oven so next time just put your hand on the stove instead"
 
@AndrasDeak Well, they ended up being dragged to the water :P
But, it's nice to see they were receptive to the feedback. Hopefully that's killed off some massive vulnerability in their own work somewhere
 
yeah, for that I am willing to retract my downvote.
 
I don't want to discourage them, but the current "do evil thing! EDIT: do other evil thing! EDIT2: no no evil things please" is still terrible
 
1:26 PM
people willing to show that they are willing to at least learn, especially while new, gets at least a tiny little bit of slack
 
I'll only undownvote after restructuring that...
Such massive caveats can't be appendices
I'll just edit it, maybe the answerer will be enlightened by it
sorry, @roganjosh :P
 
Probably best option
 
Well, I am super invested in the answer, but I'll find a way to cope with it not being done by the OP's fair hand.
 
a happy (enough) ending I supposed
 
Happily ever after is a lie anyway
 
1:35 PM
I'll shift my comment shortly. Hopefully they'll see it first
 
1:52 PM
Is there some short way to append/prepend something to a Pathlib filename? I'm currently at blah_file.rename(blah_file.parent / ('blah' + blah_file.name)), which doesn't feel particularly ergonomic.
 
I don't suppose blah_file.rename(blah_file.with_name("blah" + blah_file.name)) is any better?
 
does that actually move the file content to the new name?
 
I haven't tested it, but my guess is yes
 
The docs are... inconclusive. adjusts hat
 
it should since it seem to produce the correct values
>>> foobar = pathlib.Path('/tmp/foo/bar')
>>> foobar.with_name('blah' + foobar.name)
PosixPath('/tmp/foo/blahbar')
 
2:08 PM
It's interesting that pathlib.Path(whatever) returns a WindowsPath or PosixPath. I wonder if there are any other types in the stdlibs whose constructors don't return an instance of that exact type.
 
@AndrasDeak short term, I'm just gonna stick with plotly.js to get this project out the door. But I just spotted this and immediately got reminded of this discussion. I think that encapsulates the state-of-play with the library :P
 
type itself counts, I suppose
... Or does it. I get a headache when I think about how type's type is type. It's like the universe is dividing by zero.
 
@metatoaster Note that my initial code moves the file. This is kinda important in my case.
 
@roganjosh well at least there's an answer...
@Kevin yeah, no. type(obj) will usually give you a class which is usually an instance of type.
 
I'm guessing the non-usual case has something to do with metaclasses
 
2:14 PM
You saw that type(Path(whatever)) is not Path, whereas type(type(obj)) is type
@Kevin probably :D
 
Returning something other than a T instance from T's constructor feels like it violates one academic rule of type safety or other, but I bet if I looked it up it will turn out to be merely weird rather than disallowed
__new__'s documentation in particular is fairly explicit about not caring much about the return value's type
> The return value of __new__() should be the new object instance (usually an instance of cls).
 
As for typing, it's fine for T to return a T' where T' <: T holds true.
adjusts monocle
In other words, return a proper subtype or suffer.
 
[Liskov gives a thumbs up in the background]
 
PSA: When setting a default value, make sure that is actually a sensible value. recharges his chainsaw
 
A monocle is not sufficient eye protection when using a chainsaw. You need at least two monocles.
 
2:29 PM
I'll have quite a few monocles at the end of the day. pats chainsaw
 
monocle + OSHA-approved safety squint
 
@Kevin Yes, many people's minds are blown by the truth of isinstance(type, object) & isinstance(object, type) == True. Having grappled with much the same situation with the SmallTalk class hierarchy I find it less surprising: I surmise such a truth should exist at the bottom of all typed object-oriented languages.
 
I think you'd be better upgrading to the old aviation goggles by that point
 
I think my aversion to a T method returning a T' is a throwback from my c++ days, where a forward class declaration would frequently foretell doom for me. It usually meant I was being too clever by half.
 
Well, since clever is your normal mode I guess you just had to dial it back a bit.
Wasn't it Ritchie who pointed out that debugging required more smarts than coding, so if you used all your smarts on the code you would have problems debugging it?
My code is usually boringly comprehensible and even unadventurous most of the time.
 
2:35 PM
Brian Kernighan, if wikiquote is to be believed. "Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? "
 
I'll believe that. I know it dates back to the seventh edition days and possibly even before.
 
Seriously dude
 
^^closed Bruh :P
 
Bruh, thanks for closing :P
I'll need to set some time aside to work on my dynamicity
 
Last week on a different site I got called a troll for asking follow up questions about a vaguely defined problem
Someday I will learn the secret technique of saying "please explain further" without implying "the explanation you have given so far stinks"
Alternatively I will become the divine emperor of all I survey and I can just outright say "the explanation you have given so far stinks" and the asker gets a free mandatory trip to a week long effective communication seminar
I imagine wise king Solomon spent most of his time sending people to the back of the line to come up with a better MCVE
 
3:17 PM
"No repro" is indeed heavily used in the bible
 
:-)
 
3:36 PM
> So hard to chat in the existing Python room. Whenever you ask a question all you get is dogs/people barking at you for an MCVE
Actual quote ^
 
Woof
 
Every part of that statement is true. Are people under the impression that asking questions is supposed to be easy?
Crafting a good problem statement is 90% of the work towards solving a problem, so it stands to reason that most hard problems are also hard to ask about
The other 10% are questions like "Is P in NP?"
 
10% is generous. I don't suppose you've visited the main feed recently :P
 
Last time I visited, the first question was "how do I do N nested for loops?", and I could not muster the energy to hammer it as the millionth dupe of "tell me about itertools.product"
 
3:51 PM
Oddly, I have abarnert's profile open next to chat cos I was curious about when they were last online. I think they have some stuff to say about itertools :)
 
I unironically love jokes that require three paragraphs of explanation
 
That's gonna take some effort to get through. I'm only 1 minute in and I'm reminded of:
May 26 at 10:22, by roganjosh
"I'll just help vectorize this easting/northing to lat/long question. We don't need that pesky PyProj slowing us down. Let's find the formula"... holy hell
 
Most of the amusement comes from watching the trainwreck of a system unfold, so I give you permission to stop watching if that's not your cup of tea
 
Nah, units amuse me :)
 
Joke starts at 4:05
 
4:11 PM
I think I learned things today. I'm not quite sure what, but I learned. Middle C is definitely a new base unit for me
 
4:22 PM
For the second time in a week google translate refuses to translate a single word in a clearly non-English website. Why am I paying them for?
 
hello
 
Hello
 
@AndrasDeak you pay for google translate?
 
Oh, this is beyond a joke. I didn't even realise that dude/brah has already asked, and now they ask again. Is this flag-worthy?
@python_learner I think he was shooting for irony :P
 
@python_learner with my data
 
4:34 PM
ahh, we all pay with our data which they collect
beat me to it :p
 
@roganjosh hammered
Self-dupes are a special case, fortunately. Can be hammered without an upvoted/accepted answer on thet arget.
 
Thanks. I'm curious about what to do if they recycle the question yet again
 
Custom mod flag, probably. Or downvote until question ban kicks in.
 
"question" is being generous :/
 
5:35 PM
How was stackoverflow.com/questions/63104722/… not already closed??
Uggh that was the second copy
 
5:49 PM
Intern: I'm getting a build error "FoobarLib is not installed".
Me: Sensible, as none of our projects have used FoobarLib for five years, so having it not be installed is the ideal state.
Intern: be that as it may, I need this thing to build. Can you help?
Me: if I want to be a reliable senpai, I am obligated to say yes.
I love to do exorcisms on dlls that should have moved on already ;_;
Ah well, better me than him. No intern of mine is going to suffer through cryptic build problems alone.
... Unless I'm on lunch break.
 
6:57 PM
Me: Is FoobarLib installed?
OS: Yep.
Me: ok, where?
OS: idk lol
Me: I need the dll. Give me the dll.
OS: Relax :-) you don't need the dll. It's safe and sound in my cache.
Me: I pried open your cache with a crowbar and it's not there.
OS:
OS:
OS: Relax :-)
 
pull the power plug, that'll discipline it
 
Naughty computers do not get the sweet embrace of the void until my dark work is complete
 
On a sane OS you'd know exactly where the lib is. (Then it would only take two hours to make make find it afterward)
 
7:13 PM
File explorer: There's no directory named `c:/windows/cache/foobarlib` here, guy.
Me: Visual Studio says it exists.
File explorer: He's deluded. There's no directory by that name.
Me: I can navigate to that directory with `cmd`.
File explorer: Must be a bug, there's no directory by that name.
Me: then you won't mind if I do `explorer c:/windows/cache/foobarlib`, then?
File explorer: Oh, did you say _foobarlib_? Why didn't you say so in the first place? Here you go.
Me: Glad to hear it. Now I'm finally getting somew--
File explorer: [opens to C:\Users\Kevin\Documents, which contains no files]
Me: ಠ_ಠ
 
I see Kevin is slowly descending into madness
Hmm, I wonder if there are any good file explorers for Windows. Need to google that sometime
 
"Oh right, the directory, the directory for Kevin, the directory chosen specially by Kevin, Kevin's directory..."
(Note to self: watch The Emperor's New Groove already)
 
7:29 PM
"Open the directory, Kronk." ... "Wrong directory"
 
Watched it a few months ago, it's still good
 
Never seen it, but all the memes make it seem promising
 
If you're meme-literate you've already seen 70% of the good bits, but it's still worthwhile
 
"Why is that lever even there?"
 
That movie starts with memes, then fills in the gaps with more meme-worthy bits.
 
7:36 PM
@Kevin Need a chainsaw? It's almost practically unused.
 
Kronk's not bad either.
 
@MisterMiyagi I'm partial to the arc welder myself
Doesn't even need a power source other than my incandescent rage
I asked the Intern to try out an idea that I'm almost 40% sure will work, so for the time being I can chill
 
Sounds like against all odds to me. You'll have a relaxing week :P
 
Any luck on the weather front?
@Kevin that one I've seen!
 
7:43 PM
I forgot to look over the weekend :3 it's only 20% cloudy today though.
Intern: the error went away, and now I am getting this entirely different error.
Me: I'm counting this as a win for us.
Incidentally none of this is his fault, the rest of us have just been dragging our feet for a couple years on streamlining the project setup process.
 
Figuring that out can even be useful. I hope you're making him document it
 
7:58 PM
Nope :^)
 
8:14 PM
cbg all
 
8:25 PM
@MarcusAndrews cbg, been a while :) What's up?
 
8:36 PM
Not much, doing some chair shopping, haha -- you?
 
I misread that as "chair hopping" and was very confused for a second
 
9:01 PM
@MarcusAndrews just finished packing out stuff for the annual "garbage disposal" event
So...I'm mostly exhausted :D
 
 
1 hour later…
10:13 PM
Something tells me I should not put if len(indices) != len(geom) != 1: in library code...
 
good evening fellas
 
Hola
 
I don't understand why the following code is printing 0 instead of 1
def funct():
	x = 0

	def tests(y):
		if y == 0:
			x = 1
		return

	y = 0
	tests(y)
	print(x)
	return
funct()
shouldn't x be considered having global scope inside funct?
 
Considering the nested function, it's the nonlocal scope. And you need the global/nonlocal keywords to assign to those values, even though you can read them.
try adding nonlocal x inside tests
Names are (usually) visible in a nested scope, so you only need extra work when you are trying to rebind a name in an enclosing scope.
 
oohh I see
I thought it would work just like if there was no nested function!
alright! thanks a lot mate :D
 
10:26 PM
Side note: use four spaces, not tabs :P
 
why?
sublimetext gives me a lot of headache with indentation lol
 
Well, I'm on the "four spaces" side of the Great Indentation Wars. But I just copied your code into my ipython shell and saw a bunch of ^I escape characters and I'm struggling to introduce a literal tab on my own
 
I can declare nonlocal for a array or dict aswell, right, btw?
 
@PedroSpinola it affects how names are bound to, it doesn't know or care about types.
 
well put
:)
 
10:28 PM
But if you have a mutable container then you often don't have to use such a keyword, since you can readily mutate the original object
Try with x = [0] and x.append(1) inside the nested function. It will work with your original code.
What happened in your original code is that x = 1 defined a new local name in the nested function, which died when the nested function returned. Have you been pointed to the "python has names" page yet?
 
yup
 
Ohhh I understand now! This was making me soo confuse, because arrays were working but I was having problem with a variable!
 
That explains the significance of mutability and name rebinding. If you understand that you can easily see how x = 1 will bind the new object to a new (local by default) name.
@PedroSpinola obscure version of the Mutable Presto-Chango ;)
 
I didn't read it yet, tbh
but will do!
 
10:31 PM
@PedroSpinola you absolutely should!
 
man this project is soo much harder than I initially thought lol
it's been great
 
it covers a major hole in the mental picture of many people
 
but it's a lot of work, limited time, and I gootta priooritize
yes, will def read it now since it's the second time I have "matters" with names on python!
 
@PedroSpinola I can certainly understand that, but this not too long page is a crucial investment
 
yeah, I'm convinced :D
I appreciates Andras!
lemme keep on
 
10:32 PM
no worries
 
have a great time ;)
 
thanks, you too
 

« first day (3572 days earlier)      last day (1369 days later) »