0

Why can't I use named arguments in Python 2 in case of str.split function from the Python's standard library while I can use them for my own functions:

def foo(bar=''):
  pass

foo(bar='str')
FrozenHeart
  • 19,844
  • 33
  • 126
  • 242
  • 2
    Some built-in functions support keyword arguments http://stackoverflow.com/a/24463222/2301450 – vaultah Apr 27 '16 at 14:23
  • And some don't support them, at least in Python 2.7. In Python 2.5, `str.split` has the keyword argument `sep`. –  Apr 27 '16 at 14:25
  • 1
    The second-listed answer on the dupe explains that this is a limitation of the C-level API. – jonrsharpe Apr 27 '16 at 14:26

0 Answers0