Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.chainon-marquant.org!news-transit.tcx.org.uk!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:method': 0.09; 'chained': 0.16; 'operands': 0.16; 'subject:function': 0.16; 'subject:python.': 0.16; 'subject:release': 0.16; 'cc:addr:python- list': 0.16; 'received:74.125.82.44': 0.16; 'received:mail- ww0-f44.google.com': 0.16; 'wrote:': 0.18; '>>>': 0.18; 'string,': 0.18; 'cheers,': 0.20; '(most': 0.21; 'dec': 0.22; "doesn't": 0.22; 'header:In-Reply-To:1': 0.22; 'cc:2**0': 0.24; 'traceback': 0.24; 'message-id:@mail.gmail.com': 0.28; 'expressions': 0.29; 'print': 0.29; 'cc:addr:python.org': 0.29; 'pm,': 0.29; 'seem': 0.30; 'subject:support': 0.30; 'typeerror:': 0.30; 'tue,': 0.32; 'object': 0.33; 'last):': 0.34; 'received:74.125.82': 0.35; 'file': 0.36; 'sequence': 0.37; 'skip:" 10': 0.37; 'received:74.125': 0.37; 'received:google.com': 0.37; 'some': 0.38; 'skip:o 20': 0.38; 'correctly': 0.39; 'subject: (': 0.40; '2011': 0.61; '12:45': 0.84; 'calls,': 0.84; 'nathan': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=d1NaNoAIwEgwA4WtT7ViIuMe8+ask8VBax7ckB9Ffek=; b=vqBruV7qm3rWc87qP6oZEHh8j+OOl5tRBeR3G2OMSduYbeAUZ1hbygH/J0KnTdGVjb YE6epvSzVm4OjyI8gLTH+dc/xKP6kc5Ip1Jwnvk+t4JMVbsNgi7wavdCLQPNiwbfDO4K PMlMddN6YsQkViMWIBeXtFySRG6ac3C3LoYAs= MIME-Version: 1.0 In-Reply-To: References: From: Ian Kelly Date: Wed, 21 Dec 2011 10:54:40 -0700 Subject: Re: Elementwise -//- first release -//- Element-wise (vectorized) function, method and operator support for iterables in python. To: Nathan Rice Content-Type: text/plain; charset=ISO-8859-1 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1324490112 news.xs4all.nl 6933 [2001:888:2000:d::a6]:48038 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:17684 On Tue, Dec 20, 2011 at 12:45 PM, Nathan Rice wrote: > Elementwise provides a proxy object for iterables which supports > chained method calls, as well as elementwise expressions and some > built-in functions. It doesn't seem to work correctly when both operands are Elementwise: >>> numerator = ElementwiseProxy(range(5)) >>> denominator = ElementwiseProxy([2, 2, 3, 3, 3]) >>> remainder = numerator % denominator >>> print remainder Traceback (most recent call last): File "", line 1, in File "elementwise.py", line 72, in __repr__ return ", ".join(e.__repr__() for e in object.__getattribute__(self, "iterable")) TypeError: sequence item 0: expected string, ElementwiseProxy found >>> list(remainder) [] Cheers, Ian