News for hackers. Stuff that matters.
Re:Python’s tug of war between beginner-friendly and advance... by vasachi on Friday February 05, 2021 @01:25AM (#26033668)
I believe the idiom to check, if a parameter wasn’t set is to use an object() instance as default value.

  _notset = object()

  def foo(x=_notset):
      if x is _notset:
          print("foo was called as foo()")
Re:Python’s tug of war between beginner-friendly and advance... by andi999 on Friday February 05, 2021 @06:29AM (#26035198)
Thats nice. Thanks. Where did you find it.
Re:Python’s tug of war between beginner-friendly and advance... by vasachi on Saturday February 06, 2021 @06:36AM (#26045885)
I think it is from somewhere in standard library.