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


Groups > comp.lang.python > #64058

Re: Is it possible to get string from function?

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 <rosuav@gmail.com>
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 <roy-09327D.00403916012014@news.panix.com>
References <roy-406DCF.22465415012014@news.panix.com> <mailman.5570.1389849928.18130.python-list@python.org> <roy-09327D.00403916012014@news.panix.com>
Date Thu, 16 Jan 2014 16:47:59 +1100
Subject Re: Is it possible to get string from function?
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.5572.1389851283.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Thu, Jan 16, 2014 at 4:40 PM, Roy Smith <roy@panix.com> 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

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


Thread

Is it possible to get string from function? Roy Smith <roy@panix.com> - 2014-01-15 22:46 -0500
  Dynamic generation of test cases for each input datum (was: Is it possible to get string from function?) Ben Finney <ben+python@benfinney.id.au> - 2014-01-16 16:02 +1100
    Re: Dynamic generation of test cases for each input datum (was: Is it possible to get string from function?) Roy Smith <roy@panix.com> - 2014-01-16 00:09 -0500
  Re: Is it possible to get string from function? Chris Angelico <rosuav@gmail.com> - 2014-01-16 16:25 +1100
    Re: Is it possible to get string from function? Roy Smith <roy@panix.com> - 2014-01-16 00:40 -0500
      Re: Is it possible to get string from function? Chris Angelico <rosuav@gmail.com> - 2014-01-16 16:47 +1100
  Re: Is it possible to get string from function? Steven D'Aprano <steve@pearwood.info> - 2014-01-16 07:16 +0000
    Re: Is it possible to get string from function? Roy Smith <roy@panix.com> - 2014-01-16 09:30 -0500
  Re: Is it possible to get string from function? Peter Otten <__peter__@web.de> - 2014-01-16 09:52 +0100

csiph-web