News for hackers. Stuff that matters.
Re:Sequoia-PGP – A new OpenPGP implementation in Rust by Sean1708 on Thursday August 02, 2018 @10:54AM (#17671902)
> IMO there's a difference between "use at your own risk" and "this is actually not meant to be called from the outside and if it is it will violate some invariant in the code". Those are two different concepts and it makes sense to distinguish them.

That's what double underscores are for:

  $ python3
  Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
  [GCC 5.4.0 20160609] on linux
  Type "help", "copyright", "credits" or "license" for more information.
  >>> class Foo:
  ...     def foo(self):
  ...         print("I'm a public method.")
  ...     def _foo(self):
  ...         print("I'm a private method.")
  ...     def __foo(self):
  ...         print("I'm so private that you have to really know what you're doing to even call me.")
  ... 
  >>> foo = Foo()
  >>> foo.foo()
  I'm a public method.
  >>> foo._foo()
  I'm a private method.
  >>> foo.__foo()
  Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
  AttributeError: 'Foo' object has no attribute '__foo'
  >>> foo._Foo__foo()
  I'm so private that you have to really know what you're doing to even call me.
  >>> 
Now in theory it's not quite what you're talking about because it does rely on coder discipline to some extent, but in practice I've never seen it become an issue (although arguably that could be because not many people know that you can access double underscore variable from outside a class).
Re:Sequoia-PGP – A new OpenPGP implementation in Rust by mkesper on Thursday August 02, 2018 @12:20PM (#17672688)
Where did you get that idea from? Double underscores have to do with name mangling, nothing else https://stackoverflow.com/questions/1301346/what-is-the-mean...
Re:Sequoia-PGP – A new OpenPGP implementation in Rust by Sean1708 on Monday August 06, 2018 @12:09PM (#17698855)
It's just how I've always seen it used.