Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6873739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:06:25+00:00 2026-05-27T04:06:25+00:00

Is there any documentation on how Python’s string functions are implemented in Python? I

  • 0

Is there any documentation on how Python’s string functions are implemented in Python?

I understand that str is a built-in module, and so its functions are implemented in C.
But isn’t there code for it anyways? How about in Pypy? From what I’ve read so far, they’ve re-implemented a lot of built-in modules in Python itself.

Example Question: How is the split method of strings implemented? (Without writing my own implementation of it)

EDIT: I am not looking for an implementation written in C (which is the default implementation in the source code of Python/CPython).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:06:25+00:00Added an answer on May 27, 2026 at 4:06 am

    This doesn’t really answer the question posed, it’s just a bit too long to be a comment.

    Some quick digging through the source shows that PyPy has two implementations of split(), this high-level, readable version and this lower-level version, which appears to be the implementation of split() in rpython itself.

    Neither of these implementations are equivalent to CPython’s split() method (most obviously they do not handle the special case CPython does where the sep is not supplied). However, if you are merely interested in the basic algorithm used rather than the details, PyPy’s implementations could be a guide (at a quick glance, it looks to be doing basically the same thing as both CPython and Jython).

    As a general resource, though, there’s no reason to think that PyPy’s implementation of all string functions would mirror the algorithms used in CPython — PyPy is, after all, intended as an optimized version of Python running in a JIT, and this may have significant impact on what the most reasonable implementation of a method is (especially string functions, which frequently can be performance bottlenecks and which the implementors of an “optimized” runtime therefore have incentive to optimize).

    Thinking about the more general question, there’s very little incentive for the CPython developers to maintain a separate set of pure Python implementations of the low-level library already maintained in C. It seems that there is to much risk that the mirror implementations would grow stale or inaccurate to what is actually being done, which could ultimately be harmful for people who were trying to understand the inner workings of Python without reading the C code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The documentation doesn't guarantee that. Is there any other place that it is documented?
How does python's multiprocessing.Process's start() method work. In particular, is there any documentation for
Is there any way to search playlists on youtube using gdata-python-client? As for documentation
Is there any useful documentation for using the HOGDescriptor functionality in Python OpenCV? I
Is there any documentation on cross thread communication in Delphi? How can I send
Is there any documentation about introducing jBoss seam to an old Hibernate/JSF project? Have
Is there any clear documentation on the binary formats used to serialize the various
Is there any good documentation on implementing new refactorings in Eclipse? Specifically, I'd like
Beyond the official documentation, are there any recommended resources for learning to build jQuery
I'm seeing conflicting references in Oracles documentation . Is there any difference between how

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.