« first day (3856 days earlier)      last day (1078 days later) » 
00:00 - 19:0019:00 - 23:00

7:06 PM
Hmm, I went into "evil scientist" mode for a while and now I have the perfect weapon to end our next impromptu "who can write the worst code" competition
 
a worthy goal in life
 
7:46 PM
This code was working yesterday, and now it isn't. What's more, I can formally prove that it never should have worked. Who's been changing the underlying rules of logic and mathematics?
 
The universe.
 
Sounds like exactly what an evil scientist would do. Not to point fingers...
 
ooh
I wonder if we have one of those lurking around...
 
Don't blame it on me, I'm in my lair "improving" my weaponized code
 
Well, whoever's doing it, quit it. You know that mad professionals aren't supposed to step on one another's toes like this. Unless you schedule a rivalry ahead of time and register it at mad town hall.
When I tear a hole in space time in order to quicken my apotheosis as a being of pure reason, I have the courtesy to restrict the effects to Skull Island, my base of operation.
 
8:26 PM
Behold my masterpiece
A bajillion quatloos if anyone can guess what it does
 
heh, I'm not reading that
 
Wait, never mind. 100 quatloos for guessing what it does, a bajillion for reverse engineering it
 
class-based trickery isn't my core competency, but I'll pick at for a bit
 
just don't forget to ph'nglui mglw'nafh Cthulhu R'lyeh wgah-nagl fhtagn
 
To me, it looks like someone hit their head on the keyboard :p
 
8:36 PM
That's not far off. Now that I'm done writing it, my head does feel like it was smashed against a keyboard a few times
I think the world should consider itself lucky that I (usually) use my powers for good rather than evil
 
phew, lucky us
 
9:37 PM
I understand view spoiler and view spoiler, but I don't yet understand view spoiler
 
I didn't understand any
Probably just my limited terminology though
 
terminology is necessary, but not sufficient, to understand the behavior of the class system inside and out
 
I know concepts, but not most terms...
 
I know this because I have hella terminology knowledge but I do not know how python turns a class definition into an actual type
beyond "it gathers up the important bits and then calls three-argument type on them"
 
I just know to not question the work of gods
 
9:42 PM
You could have a long and fulfilling career without ever understanding a word of section 3.3.3 customizing class creation, so not questioning things is a valid strategy
The only time* I am remotely tempted to delve into its secrets is when I have to write about a dozen classes, all slightly different, and I think "if only there was a way I could... Customize the creation of these classes"
(* for actual useful practical purposes. I'll delve into any scary corner of the language if it's for an obfuscated code puzzle that has no tangible reward)
 
Cabbage! Wow, it's been a while since I visited this chat room. Or done any python :(
 
@Kevin Isn't this what magic methods are for? Or are you going further?
 
Just saw this in my workplace's python style guide and thought it'd make some of the people here giggle or faint:

> Lines should not exceed 450 characters long. A line is considered long after 120 characters.
 
@12944qwerty Way further.
 
@Domino I never follow that rule
 
9:52 PM
@Domino That's in the ballpark of my own definition of "long", which is "wraps to a second line even when the editor is maximized"
 
My IDE's normally wrap the code so I never really felt the need
 
I think it's fair to assume the 79 character limit is the one PEP8 rule that gets ignored the most.
 
The anecdata available to me agrees
 
Hah, anecdata. I like it.
 
@Domino How long?
 
9:55 PM
It's a very good word for making people think you're smart, or making them think that you're trying to make them think you're smart
 
I haven't done a serious amount of python since my last internship so... 3 years, perhaps?
 
But you do other programming?
 
Mostly front-end web dev. I've been working with Angular since November.
But I'm going to take a break from that to work on back end code a bit, since we're short on people.
Meaning: python.
🥳
 
Or javascript :/
I really don't like front-end... it's ok, but it's definitely no where near my specialty
 
Well, welcome back. Let's see, what cool stuff happened these last three years... walrus operator, guaranteed order of dicts, GVR retired kinda...
 
10:02 PM
End of python 2 support :P
 
A surprisingly sedate affair, when the clock ticked to zero. I think most of us had already suppressed the memory of 2.7's existence at that point
 
GVR?
 
Guido.
 
Guido Van Rossum, inventor of Python and self-declared Benevolent Dictator For Life
 
I learned python 2.7 first... only because I didn't want codecademy premium 😅
Oh :(
 
10:04 PM
Ok, I will accept "I didn't want to spend money on the most recent Python course" as a valid reason to learn 2.7 in modern day times. Everyone who says "Idk, it was the first thing that turned up on google" is still on the hook.
 
@12944qwerty I like how tactile frontend is. You can write a bit of code and immediately see a result, kinda like doing Python in REPL.
 
It was like 4-5 years ago though... 2.7 was still a bit popular
 
People who say "this blogger of relatively good repute said that 2.7 was superior to 3.X" get a slap on the wrist, and that blogger gets bumped up the Enemy Of The State list
 
Haha, agreed.
 
The only difference that I needed to know was raw_input and print
Every other change I learn directly in python 3 instead
 
10:06 PM
Knowing python 3 supported unicode was enough for me.
 
Yeah, input and print are the biggest differences until you get to upper-intermediary
 
NameError solved the habit of raw_input easily
 
(Disclaimer: I have no intention of taking any punitive action against aforementioned bloggers with atypical opinions)
 
It's their opinions. I wouldn't expect you to
@12944qwerty And SyntaxError for print
 
I learned Python the hard way in college, working on a project that needed to work on Mac and Windows while most of us were developing on arch. Plus we used wxWidgets for the UI and the documentation for the python version was down so we had to rely on the ruby documentation.
 
10:11 PM
If you want a 2.7/3.X difference that will sneak up behind you, the biggest offender is 3/2. Evaluates to 1 in 2.7, and 1.5 in 3.X.
 
@Kevin Yikes, forgot about that one.
 
Is it specifically 3/2? Or most divisions...
 
Most divisions.
I had a couple algorithms that started looping infinitely (or near enough) after I switched to 3.X. My initial design assumed that if I divided an integer by 2 enough times, it would eventually equal 1. Not a great assumption to make any more.
 
@Domino >:|
 
Haha, found someone who cares about 79 :P
 
10:14 PM
Wouldn't it? I can't remember if it'd return an error or not because of how floats work
 
I rarely keep 79. But 450 is -------------> way over the board there
 
As in, "wouldn't it eventually reach 1?". Only if it started out as an exact power of 2. Otherwise, it will sail right past 1 and eventually reach 0.
 
Funny enough, I still avoid docstrings longer than 79 characters in other languages as a force of habbit.
 
Similar kek
 
@Kevin Years of programming in JavaScript means I always triple check for edge cases like these. Never assume things to be logical x)
 
10:17 PM
I normally just run the code and see the bugs i come across.... much easier for me
 
just write bug-free code
 
@AndrasDeak Unironically what my C++ teacher would tell us.
 
I, too, run code to see if it raises any exceptions that need fixing. It doesn't always work, though, for example if your code loops forever instead of crashing.
 
That's still an error in my mind
 
Like the scenario I just talked about -- while x != 1: x /= 2 doesn't crash, it just quietly consumes cpu cycles forever
 
10:19 PM
should've gone with //= even on pythoff
 
pythoff?
 
Quick question: why is it that when I am saving a variable and its contents in a text file l, it automatically adds a blank line between lines? And how can I get rid of these blank lines?
 
What's your code
 
write calls typically do not insert newlines on your behalf, so something unusual is going on
 
"Debugging is difficult and a waste of time, especially when working with a language that lets you shoot yourself in the foot because calling gun.fire() before gun.aim() is unexpected behavior."
That teacher was a gem.
 
10:22 PM
@12944qwerty let me get it
 
@Kevin probably print
 
names = table.text.strip()
name = names.replace('\n\n', '')

a = open('media.txt', 'w')
a.write(name)
a.close()
 
@AndrasDeak Even these days I basically never use the // operator. If I want truncated division, I probably also want the remainder, so divmod is my weapon of choice
 
*taps crystal ball*
 
If I print (name) there are no blank lines printed between each line however saving the variable in a text file adds a blank line between each line
 
10:25 PM
Hmm, file objects don't convert \r to \n on your behalf, do they...?
 
@Kevin ?
 
@Ahmed.B Try print(repr(name)) and see if there are any escaped whitespace characters around where your double newlines are
\r is the most likely culprit but maybe some \n instances made it through your replace call
 
@Kevin the lines are gone but the result is all under one single line and there are no whitespace characters however there are \r\n\r been added between each line.
 
Ok. In that case, try name = names.replace('\r', '').replace('\n\n', '')
What I think is happening is, your string has data like "line A goes here \n\r\n\r line B goes here". Calling .replace('\n\n', '') on this does nothing because there aren't any newlines next to one another in the string. But when you write to the file, it still renders a complete blank line between lines A and B.
 
10:40 PM
@Kevin ok so that got rid of \r however there is still one \n left between the lines
 
That's what you wanted, right? If you want to get rid of all newlines, then you can just do name = names.replace('\r', '').replace('\n', ''). Then everything will be on one line guaranteed
 
@Kevin ok makes sense appreciate your help
 
00:00 - 19:0019:00 - 23:00

« first day (3856 days earlier)      last day (1078 days later) »