News for hackers. Stuff that matters.
Re:I'm Switching to Python and Actually Liking It by Izkata on Wednesday July 16, 2025 @12:36PM (#44584257)
There's actually 4 kinds:

  def foo(... # public
  def _foo(... # internal
  def __foo(... # munged
  def __foo__(... # magic
Internal is more convention as the language doesn't really do anything with it, but it does with munged, and magic methods are specifically for things implemented in the language.

Internal and munged don't exactly map to private and protected, but are kinda similar ish.

Re:I'm Switching to Python and Actually Liking It by freehorse on Wednesday July 16, 2025 @01:50PM (#44585040)
Oh right. I am not really into python, had read some doc about naming conventions some poitns.

In any case I actually like how one can use underscores to point on how exposed some method is supposed to be. Makes it simpler to actually know what to skip and what not.