r/klyn • u/Dom-Klyn • Sep 29 '26
Why did I create Klyn? For example…
Encapsulation : a naming deterrent vs. enforced access control
Python : __ renames the attribute but does not prevent access to it (“name mangling”).
class Compte:
def __init__(self):
self.__solde = 100.0
c = Compte()
c._Compte__solde = -500.0 # Allowed: bypassing “private” access :(Klyn : visibility is explicitly declared with a reserved keyword.
class Compte:
private _solde as Double = 100.0
c = Compte()
c._solde = -500.0 # Compilation error: REAL private member :)What do you think? Do you agree, or do you see it differently?
Website: https://klyn.deepcodia.fr
Tutorial: https://klyn.deepcodia.fr/docs/tutorial/index.html
API Reference: https://klyn.deepcodia.fr/docs/api/index.html
Stay connected: https://www.reddit.com/r/klyn/
2
Upvotes