Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #100218

Re: How to use internal python c funtions, from python code

From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: How to use internal python c funtions, from python code
Date 2015-12-10 15:53 +1100
Message-ID <mailman.105.1449723237.12405.python-list@python.org> (permalink)
References <CACs7g=DG2Ns8EER5iULogGmGLcny6_JyctYF_W_OdNZtjn3UCQ@mail.gmail.com>

Show all headers | View raw


On Thu, Dec 10, 2015 at 3:44 PM, srinivas devaki
<mr.eightnoteight@gmail.com> wrote:
> For competitive programming purposes I really want to use those functions
> for speed.

Recommendation: Write your code the simple and obvious way, and *then*
start thinking about speed. And before you look at calling on C code
manually, try running your code in PyPy, and then try making use of
Cython.

For the specific example of converting an integer into a string using
a particular base, there are quite a few options available; but I
would recommend using the very simplest you can get away with.

ChrisA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: How to use internal python c funtions, from python code Chris Angelico <rosuav@gmail.com> - 2015-12-10 15:53 +1100

csiph-web