Home > other >  python str.casefold() implementation location
python str.casefold() implementation location

Time:01-21

Where is the implementation of the str.casefold() method in the python source code? I searched for the string "casefold" in the github repository cpython. I found a test but not the definition of the method.

https://docs.python.org/3/library/stdtypes.html#str.casefold

https://github.com/python/cpython

https://github.com/python/cpython/blob/83d544b9292870eb44f6fca37df0aa351c4ef83a/Lib/test/test_unicode.py#L829

CodePudding user response:

The casefold dispatcher is implemented there, you can just look up the functions it dispatches to.

https://github.com/python/cpython/blob/f4c03484da59049eb62a9bf7777b963e2267d187/Objects/unicodeobject.c#L10967

  •  Tags:  
  • Related