• Home
  • Raw
  • Download

Lines Matching refs:positional

324 You can use positional parameters with some builtin classes that provide an
628 parrot(1000) # 1 positional argument
632 parrot('a million', 'bereft of life', 'jump') # 3 positional arguments
633 parrot('a thousand', state='pushing up the daisies') # 1 positional, 1 keyword
642 In a function call, keyword arguments must follow positional arguments.
662 receives a :ref:`tuple <tut-tuples>` containing the positional
721 positional-only, positional-or-keyword, and keyword-only. Keyword parameters
736 as *positional-only*. If *positional-only*, the parameters' order matters, and
739 separate the positional-only parameters from the rest of the parameters.
740 If there is no ``/`` in the function definition, there are no positional-only
743 Parameters following the ``/`` may be *positional-or-keyword* or *keyword-only*.
783 The second function ``pos_only_arg`` is restricted to only use positional
792 TypeError: pos_only_arg() got some positional-only arguments passed as keyword arguments: 'arg'
800 TypeError: kwd_only_arg() takes 0 positional arguments but 1 was given
811 TypeError: combined_example() takes 2 positional arguments but 3 were given
822 …TypeError: combined_example() got some positional-only arguments passed as keyword arguments: 'pos…
825 Finally, consider this function definition which has a potential collision between the positional a…
839 But using ``/`` (positional only arguments), it is possible since it allows ``name`` as a positiona…
846 In other words, the names of positional-only parameters can be used in
859 * Use positional-only if you want the name of the parameters to not be
862 is called or if you need to take some positional parameters and arbitrary
867 * For an API, use positional-only to prevent breaking API changes
891 keywords rather than positional arguments. ::
907 but need to be unpacked for a function call requiring separate positional