Path: csiph.com!optima2.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!1.eu.feeder.erje.net!ecngs!feeder2.ecngs.de!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'correct.': 0.07; 'override': 0.07; 'cc:addr:python-list': 0.09; 'extension.': 0.09; 'subject:using': 0.09; 'python': 0.10; 'subject:not': 0.11; "skip:' 30": 0.15; '.dll': 0.16; 'bisect': 0.16; 'wrote:': 0.16; 'language': 0.19; '>>>': 0.20; 'windows': 0.20; '2015': 0.20; 'developer': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'aug': 0.20; 'extension': 0.20; '(on': 0.22; 'object.': 0.22; "skip:' 40": 0.22; 'sorry,': 0.22; 'am,': 0.23; 'this:': 0.23; 'import': 0.24; 'written': 0.24; 'header:In-Reply-To:1': 0.24; 'mon,': 0.24; 'module': 0.25; "doesn't": 0.26; 'not.': 0.27; 'subject: ?': 0.27; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'module.': 0.27; 'correct': 0.28; 'function': 0.28; 'objects': 0.29; 'asked': 0.29; 'url:mailman': 0.30; 'skip:_ 10': 0.32; 'url:python': 0.33; "d'aprano": 0.33; 'everyone.': 0.33; 'steven': 0.33; 'url:listinfo': 0.34; 'members.': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'world,': 0.35; 'question,': 0.35; 'asking': 0.35; 'but': 0.36; 'list,': 0.36; 'should': 0.36; 'url:org': 0.36; 'email addr:python.org': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'two': 0.37; 'times.': 0.38; 'mailing': 0.38; 'means': 0.39; 'goes': 0.39; 'does': 0.39; 'url:mail': 0.40; 'where': 0.40; 'your': 0.60; 'determine': 0.61; 'above,': 0.63; 'believe': 0.66; 'python-list': 0.66; 'email name:python-list': 0.67; 'day': 0.67; 'answer.': 0.72; '2.7.': 0.84; 'answer,': 0.84; 'working,': 0.84; 'to:none': 0.91; 'joel': 0.91; 'sorry.': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=/nksk/3sdxOfmasxBdanSfSp5RC/flFRoK/SXeY7LaY=; b=O2YYa3v0cqcaPc7gLNVtX9tHI7Q2kBSfYmG7y3NQTuc1Ko4ytS/NvHdfbazX+ha1V+ l3/qYtsZg9kYKDDy/M5n3q9lCtpC2C/1/6dwENlM53wxT9cFBusVosbr/xKHHNnzP6yo KLlZnHS0dlLTcrF67nORuQ539Rfah4qWpalMVPcqkaFE6E/cQ6Rc0t5mBCn/XnKxfmB0 IQyHNy7eqxrz/32D+ozLwlZPHSzHnmY+e8FswxTXFXfiFfviGF1SMXjErS+LP0JeRdhv Ui37f4CRjLHj7qDhjUwcLnzkGuN+gZiZphUzgSirvOFIPnXtxkYaUdtcHDVtVO2cx9Nl 4sbw== MIME-Version: 1.0 X-Received: by 10.50.79.196 with SMTP id l4mr21042228igx.48.1438611096127; Mon, 03 Aug 2015 07:11:36 -0700 (PDT) In-Reply-To: <55BF7457.8030704@gmail.com> References: <55bf6e6f$0$1650$c3e8da3$5496439d@news.astraweb.com> <55BF7457.8030704@gmail.com> Date: Mon, 3 Aug 2015 10:11:36 -0400 Subject: Re: how to determine for using c extension or not ? From: Joel Goldstick Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 88 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1438611099 news.xs4all.nl 2946 [2001:888:2000:d::a6]:39924 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:94939 On Mon, Aug 3, 2015 at 10:01 AM, umedoblock wrote: > sorry, Joel, Skip, Steven, and python-list members. > > I think that I don't sent my mail to python-list@python.org or I don't ha= ve > correct mail setting. > > so I send many mails. > > sorry... I should wait a day to get answer, sorry. > > > On 2015=E5=B9=B408=E6=9C=8803=E6=97=A5 22:36, Steven D'Aprano wrote: >> >> On Mon, 3 Aug 2015 03:47 pm, umedoblock wrote: >> >>> Hello everyone. >>> >>> I use bisect module. >> >> >> You asked the same question FOUR times. Have patience. Your question goe= s >> all over the world, people may be asleep, or working, or just not know t= he >> answer. If you ask a question, and get no answers, you should wait a ful= l >> day before asking again. >> >> >>> bisect module developer give us c extension as _bisect. >>> >>> If Python3.3 use _bisect, _bisect override his functions in bisect.py. >> >> >> So does Python 2.7. >> >> >>> now, I use id() function to determine for using c extension or not. >> >> >> The id() function doesn't tell you where objects come from or what >> language >> they are written in. But they will tell you if two objects are the same >> object. >> >>>>>> import bisect >>>>>> id(bisect.bisect) >>> >>> 139679893708880 >>>>>> >>>>>> import _bisect >>>>>> id(_bisect.bisect) >>> >>> 139679893708880 >>> >>> they return 139679893708880 as id. >>> so i believe that i use c extension. >> >> >> Correct. >> >> Also, you can do this: >> >> >> py> import bisect >> py> bisect.__file__ >> '/usr/local/lib/python2.7/bisect.pyc' >> py> bisect.bisect.__module__ # Where does the bisect file come from? >> '_bisect' >> py> import _bisect >> py> _bisect.__file__ >> '/usr/local/lib/python2.7/lib-dynload/_bisect.so' >> >> So you can see that _bisect is a .so file (on Linux; on Windows it will = be >> a .dll file), which means written in C. >> >> > > -- > https://mail.python.org/mailman/listinfo/python-list Welcome to the mailing list, and as I see above, you got a good answer. --=20 Joel Goldstick http://joelgoldstick.com