Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!ecngs!feeder2.ecngs.de!novso.com!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; '16,': 0.03; 'function,': 0.09; 'subject:string': 0.09; 'cc:addr:python-list': 0.11; 'jan': 0.12; '"about': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'roy': 0.16; 'shortcut': 0.16; 'subject:possible': 0.16; 'zero.': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'work,': 0.20; 'code,': 0.22; 'cc:addr:python.org': 0.22; 'skip': 0.24; 'cc:2**0': 0.24; 'long,': 0.26; 'somewhere': 0.26; 'header:In-Reply-To:1': 0.27; 'characters': 0.30; 'then.': 0.30; 'message-id:@mail.gmail.com': 0.30; 'that.': 0.31; 'thanks!': 0.32; 'another': 0.32; 'subject:from': 0.34; 'no,': 0.35; 'test': 0.35; 'but': 0.35; 'received:google.com': 0.35; '2500': 0.36; 'subject:?': 0.36; 'should': 0.36; 'window': 0.38; 'pm,': 0.38; 'easy': 0.60; 'smith': 0.68; 'subject:get': 0.81; 'to:none': 0.92 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; bh=6xOyHGqFtWmbmVu46eiodLKikvwhuzRb+/cmt98AbsE=; b=0ws4bXZgktkmuHfnRgybNMwku9JPI2ibljy5DlpWFZyb3UgmeDbREM++OFRmMKD/R/ JmJSm8orSCMqDyYCPNrLk1GyRElydC3+q7qiuu95p3UfwZpRxtRp6cn6mDAXaY7edKT+ 3RxRxEh0ZZQiD5a9Ng/C7LNPGGVfkKNp58C4V7xsNgvwJWYABDocx6hRx0FhtYI3BIKJ Ta8TUrhX4CaqNBddzF6xCq2OxJbslnfsLw431uGLUmD3c1GzBrWza1GAW4eIKrKzsFfX cUo7VJTwfxDLoRRJ0Mn0VzRLxKUefq3R7Tu2BFEpg9Kk3ISYgE9nggudjYuWWHgQ79Nf qCCw== MIME-Version: 1.0 X-Received: by 10.66.163.36 with SMTP id yf4mr7716981pab.67.1389851279871; Wed, 15 Jan 2014 21:47:59 -0800 (PST) In-Reply-To: References: Date: Thu, 16 Jan 2014 16:47:59 +1100 Subject: Re: Is it possible to get string from function? From: Chris Angelico Cc: "python-list@python.org" Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1389851283 news.xs4all.nl 2901 [2001:888:2000:d::a6]:46062 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:64058 On Thu, Jan 16, 2014 at 4:40 PM, Roy Smith wrote: >> But you might be able to shortcut it enormously. You say the strings >> are "about 2500 characters long, hex-encoded". What are the chances of >> having another constant, somewhere in the test function, that also >> happens to be roughly that long and hex-encoded? > > The chances are exactly zero. > >> If the answer is "practically zero", then skip the code, skip >> co_names, and just look through co_consts. > > That sounds like it should work, thanks! > >> Of course, this whole theory goes out the >> window if your test functions can reference another test's RECEIPT; > > No, they don't do that. Awesome! Makes it easy then. ChrisA