Hacker News new | ask | show | jobs
by chrismorgan 980 days ago
Python has supported keyword-only arguments since 3.0, and added positional-only arguments in 3.8+ <https://docs.python.org/3/whatsnew/3.8.html#positional-only-...>:

  def name(positional_only_parameters, /, positional_or_keyword_parameters, *, keyword_only_parameters):
      pass
I don’t use Python much these days, and Rust and JavaScript don’t have equivalents, so I haven’t thought much about this, but my gut feeling is that there’s probably never a good reason to support taking an argument by both position and keyword, that it should instead be one or the other. But as I say, I haven’t meditated on this. Curious if any popular linting tool has rules to detect any of these three classes of argument (… and also args and *kwargs).