« first day (2565 days earlier)      last day (2399 days later) » 
01:00 - 20:0020:00 - 00:00

wim
8:00 PM
yeah, nobody uses the feature. there was another one that got changed, exec I think it was ...
and yield is in some kind of weird middle ground
 
Yes, exec.
 
DSM
(36) dsm@winter:$ grep print **/*.py | wc
    771    2803   59812
(36) dsm@winter:$ grep assert **/*.py | wc
    314    1576   30254
In my current project it's only 2+:1..
 
wim
that's a hell of a lot of prints
 
we should break compatibility for exec during every major version release just because exec-users deserve it
4
 
wim
I think I would have way more asserts than prints, if you include the tests/ subdirs
 
8:01 PM
Make it a statement for even numbered Pythons, and a function for odd numbered ones.
 
wim
after an app is no longer a toy anymore, all prints get converted to logging calls
 
DSM
I tend to use prints for debugging purposes and only switch to logging at the end. This is still in dev, so I have prints everywhere..
 
Antti's eval / exec / compile "Bible" stackoverflow.com/a/29456463/4014959
 
wim
speaking of logging, is there any inverse of logging.getLevelName? please don't say getattr ...
 
With all the async for and async with and __aiter__ and all that we're getting for async functions, I wonder if we'll ever get __aadd__ and async +. Because hey, maybe you want to yield halfway through an addition.
 
DSM
8:06 PM
@wim: there's _levelToName, if you don't mind the underscore..
 
I wonder what's the percentage of Python code in the whole world, ranked by skill level of the author. How many LOCs from ten year veterans are there, compared to LOCs from 24 hour greenhorns
If the base of the skill pyramid is real wide, then I'd expect prints to still dwarf asserts even if they're pretty spare in mature code bases
 
@wim: The inverse of getLevelName is getLevelName, confusingly.
 
DSM
@user2357112: what black magic is this?!
 
wim
oh. right you are.
what a weird surprise
 
Except in 3.4.0 and 3.4.1, I think. It was undocumented and taken out, then put back in for backward compatibility. It's technically documented now, because the docs now talk about how the behavior was taken out and put back in.
@DSM: Yeah, it's weird.
 
wim
8:12 PM
it doesn't handle case insensitivity :(
 
@Kevin I suppose that depends on what's in the "mature code base" - when I've been writing something so far, my final version generally has very few print statements, but the iterations that came before have many more. So even the more mature codebases might have a bunch from early iterations?
 
wim
it probably depends if you write apps or libraries more
I mostly develop library code so use print statements calls pretty much never
 
cabbage. Still a thing here?
 
wim
it's Kimchi now
 
Oh really?
 
8:14 PM
But that stinks, so we mostly leave it buried.
 
DSM
Cabbage, @Johnston. :-)
 
cabbage @DSM
How do you write Big O notation for things that things that loop inside of a loop but unrelated. Like loop through ['hi', 'bye', 'yes', 'no']. In the loop word.split('').sort().join()... That inner looping loops also but not through the original array.. Loops with split, sort and join. etc.
 
wim
you can't .sort .join like that but I get what you're saying
 
You get the idea. :D
 
Still works the same
Just you might have M and N
 
8:17 PM
I guess you need to assume something about your list contents
length-k or length-3 (const)
 
@wim they're stupid
 
I don't think Python has any guarantees about getting stuff out of memory, but is there anything besides del <variable> that are better?
 
wim
wouldn't that still be O(n log n) because the sort dominates whatever happens with the split and join
 
@wim but that n is not n
the n is presumably with respect to the length of the input list
 
@AndrasDeak it is
 
8:18 PM
(security requirements at work are improving, which is a good thing. I'm sure del var satisfies, but if I can be more secure for reasonably little effort, I'm always a fan)
 
if we assume that it is words and not random runs of characters.
 
wim
I mean, both n is the n (length of list) and the m (avg length of words) is irrelevant
 
So how would you write it?
 
it isn't if there is always constant number of fragments
@Johnston write what?
 
some mathematical rigour is probably beneficial here
 
8:19 PM
you can't do .join()
you must do ''.join(sorted(word.split())) because that is what is obvious if you're Dutch.
 
wim
@WayneWerner let me guess, compliance for dealing with credit card data ?
 
and also, your variable named word consists of ... several words
 
@AnttiHaapala no, I think word loops over the list-of-words
hence the question about big-O, because you have multiple scales
outer loop over n number of words, inner "loop" over m length of a given word
 
@wim not particularly CC data, but, same idea :)
 
8:22 PM
@Johnston in that case, it is O(n).
because your data is words, and you're only sorting the letters in words...
words are of max constant length
 
wim
__del__ is called when ref count goes to zero. that's all you can say really.
--- assuming someone hasn't turned off GC, which is also possible (and actually sometimes useful in containers) ---
and I'm pretty __del__ doesn't get anything out of memory. just puts that memory up for grabs again.
 
wait, wasn't there something about GC being an additional level of magic above refcounting?
 
gc doesn't affect refcounting
 
i.e. that GC catches circular references (and similar nontrivial stuff?), but free-when-0-references works always and separately?
 
wim
gc is just there to break up cyclic refs
yes, when ref count goes to zero __del__ gets called and gc has no part in that matter
it happens even if you disable gc
 
8:25 PM
okay
 
wim
hmm, I tried to strike out my reply up there, why didn't that work
(answer: leading/trailing space not allowed)
 
yup ^
 
@WayneWerner Take a look at Memory Management. It's mostly for people who are writing C extensions or embedding the interpreter, but it does have useful info about how Python's memory management works, and the concept of memory arenas.
 
wim
at a previous company I had a colleague that would del all his local variables before returning from a function .. "to save memory"
 
LOL
 
8:32 PM
That works
 
wim
I tried to explain that just exiting the function block would also decrease the ref count, and he started to argue that I was wrong
 
He didn't need to remember how Python works if he does that
 
it must be because closures
 
wim
honestly I would have preferred a blank stare, then I could at least explain it
 
or maybe a "haha, you can never be too careful"
 
DSM
8:54 PM
AAAARGH
 
? you okie DSM ?
 
DSM
I've been trying to figure out off-and-on for days why a certain number was showing up as 28 in my C++ code and 23 in my Python code (breaking the Python). It turns out to be because a certain setup string was basically 101,59,ABCCOMMAND_DEFAULT,60,200726 in the C++ and 101,59,"ABCCOMMAND_DEFAULT",60,200726 in the Python. The latter isn't correctly parsed by the receiver, and corrupts the data flow.
 
=O ...here has some pineapples for figuring it out ... time for home time man...
 
rhubarb to all, and to all a good night, when it comes.
 
wim
anyone familiar with aws list_objects_v2 ?
specifically, does it have any reliable ordering or can the ordering be specified?
 
DSM
9:07 PM
@MooingRawr: good idea. Rhubarb for all.
 
What are the odds that this becomes a HNQ today?
sigh
 
@vaultah >0.5
rhubarb for DSM
 
rbrb \o
 
 
1 hour later…
10:25 PM
afternoon cabbage
 
cbg
 
11:06 PM
How are you Andras?
 
very tired, thanks ;)
it's 1 AM here and I'm just about to go to sleep
how are you?
 
Heading home from work. 5pm here
And checking chat history to see if there is anything interesting
 
I think there were a few things (but I was mostly busy all day, only peeking at the room every now and then)
have a nice evening
rhubarb
 
01:00 - 20:0020:00 - 00:00

« first day (2565 days earlier)      last day (2399 days later) »