https://kotlinlang.org logo
#random
Title
# random
g

gabrielfv

10/22/2018, 5:00 PM
Accordingly to Python, you only have a
self
if you've been initiated, and could be offensive towards the uninitiated.
💯 2
k

karelpeeters

10/22/2018, 5:20 PM
That's wrong though, classes do have
self
-things before initialization, it's exactly what you use to initialize. (Nitpicking on a joke, I know ...)
g

gabrielfv

10/22/2018, 5:26 PM
It's the product of initiation process, created prior to construction but only when it's triggered... Or did I get something wrong?
k

karelpeeters

10/22/2018, 8:49 PM
Copy code
class Foo:
  def __init__(self):
    print(self)
    self.x = 5

Foo()
The
self
instance already exists before running init, right?
n

napperley

10/23/2018, 12:05 AM
Thought you were talking about Python's over extensive use of
self
, aka Self Hell 🔥 ( https://news.ycombinator.com/item?id=8834687 ). I have invented a term for it: Selfitis 😆 .
t

thomasnield

10/23/2018, 1:27 AM
Well how are you supposed to construct types at runtime? Is that not what dynamic typing does? At runtime, "self" is a blank slate that you can do all kinds of crazy meta things to.
3 Views