Show newer

re: ⚠️ i've been writing python for most of my time on earth ⚠️ 

@vaporeon_ @monorail @The_T normally in OOP, object instantiation logic is contained within a constructor, but Python decided to split the process into two steps:

1) __new__ is a function which returns the instantiated object,
2) __init__ is a function that receives the instantiated object and and initializes its state

It is very rare that a Python programmer ever use __new__. In 99% of cases, what you would put in a constructor in some other language is put in the __init__ method when you use Python.

You can override __new__, however, so that it returns anything you want. You typically do this when you subclass immutable types. Because, if you try to manipulate a subclassed immutable object in the __init__ function, well you can't. Because its immutable. So you have to override the creation of the object itself, typically by calling the superclass's constructor, in the __new__ method.

type of guy who sends a 76.4MB 24-second video over signal on dogshit wifi

@cam you're bringing me back to my "watching street vendors make chai masala" phase

definitely not an image of clodsire holding a gun 

@aescling @Satsuma @vaporeon_ @Lady figure it out and help me.

@cam @Kirito at first i thought this was an overwatch toot for some reason lmao

@aescling @vaporeon_ @Lady I know we can do it technically, I specifically am asking you to add it to our frontend.

@vaporeon_ yeah i reported @aescling and @Lady daily for it but they still haven't fixed it

@cam holy shit once i noticed the eggy crust i pogged irl

Apparently I need to post about JavaScript more so I can salvage my legacy

@vaporeon_ even more specifically, I had to write C++ as an undergrad in college for my physics research and when reading something that the creator of the language (Rene Brun) wrote, they mentioned you could iterate over some data using a construct like the following:

for (TList&& thing: listOfThings) { /* use the thing /* }

and then Brun was like "if you're not familiar with the double ampersand syntax, its a relatively new language feature called an rvalue reference" and I was like "the fuck is an rvalue reference"

So then I started reading and then eventually got to this web page: en.cppreference.com/w/cpp/lang

and my poor undergraduate mind was just like o______________________________________o so I gave up on it.

But it lingered in my mind for years later as a Thing That I Could Not Understand. It ate away at me. I tried again later in grad school, only to go o______________________________________o again. Maybe this was simply beyond me.

Flash forward a couple more years and now I'm a software engineer. Then they made me do C++ for work. I'm like, "I'm more familiar with software these days maybe finally I'll undestand it" so I researched it again only to go o____________________________________o once again.

But no, this cannot be! I WILL do it!! I WILL FIND OUT!!!! So i kept at it for months afterwards and he we are.

@vaporeon_ I would much rather my legacy involve Beautiful javascript instead of Nightmare c++

@vaporeon_ I write C++ unwillingly in the pursuit of Understanding because I WILL fuck around and I WILL find out

@cam doesn't stop me and i turned out.... well perhaps you shouldn't do it actually

Show older
📟🐱 GlitchCat

A small, community‐oriented Mastodon‐compatible Fediverse (GlitchSoc) instance managed as a joint venture between the cat and KIBI families.