파레로그

Blog of Far Away 6834

View My GitHub Profile

28 July 2026

PythonFunctionArgumentSigniure : Learn about "Python Function Argument Signiture" by using Syntax-Rule

by

PythonFunctionArgumentSigniure : Learn about “Python Function Argument Signiture” by using Syntax-Rule

  1. SyntaxError : / must be ahead of * : when function signiture is f(⋯, *argv, ⋯, /, ⋯) -> ⋯
  2. SyntaxError: * argument may appear only once : when * argument is apper more once
  3. SyntaxError: arguments cannot follow var-keyword argument : when arguments are follow after **kargv i.e. “every function signiture is kargv included signiture or kargv excluded signiture” ⋯ Priniple Of Kargv
  4. SyntaxError: parameter without a default follows parameter with a default : when function signiture is f(⋯ (n.b. no * argument is placed in here), ParamWithADefault = "♡", ⋯ (n.b. no * argument is placed in here), ParamWithoutDefault, ⋯)
  5. “TypeError: function name missing 1 required keyword-only argument: ‘[KwOnlyArgv]’” : when call function which signiture is [function name](⋯, any * argument, ⋯, [KwOnlyArgv]) without setting [KwOnlyArgv] = [value]
  6. TypeError: [function name]() got some positional-only arguments passed as keyword arguments: '[PosOnlyArgv]' : when call function which signiture is [function name](⋯, [PosOnlyArgv] (n.b. it can have default value), ⋯, /, ⋯) as “[PosOnlyArgv] = value”
  7. SyntaxError: at least one argument must precede / : when function signture is [function name](/, ⋯)
  8. SyntaxError: named arguments must follow bare * : when function signiture is [function name](⋯, *)
  9. n.b. (*, **) is actually (*, ). because ** is syntax error, so no argument is after *. only error are fllows. and…. (, /) or”(*, )is also case of (/, ⋯) and (⋯, *)

summarry : argument part of pythonic function signiture must be (⋯(optional : pos-only without default)⋯, ⋯(optional and conditional : pos-only with a default (when pos without default is not exist))⋯, (conditioanl : / symbol (when pos-only argument is exist)), ⋯(optional and conditional : pos without default (when pos-only with a default is not exist))⋯, ⋯(optional and conditonal : pos with a default)⋯, (conditionally optional : * argument (optional when kw-only argument is not exist, if else, * argument must be exist)), ⋯(optional : kw-only argument), (optional : var-keyword argument)) (non type-hinted ver expression)

writen by FarAway6834, Jul 28, 2026

NOTA BENE (FUTUTUS GRAVITER CAUTIO) : MY ENGLISH SKILL IS FUCKING TERROBLE. SUCKS. I CANNOT SPEAK ENLISH AS VERY WELL. I APPOLOGIZE THIS GOD DAMB ISSUE

tags: