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


Groups > comp.lang.python > #20858

Re: PyWart: Language missing maximum constant of numeric types!

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!cs.uu.nl!news.stack.nl!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python@mrabarnett.plus.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'else:': 0.03; 'elif': 0.04; 'subject:missing': 0.07; 'python': 0.08; 'be:': 0.09; 'from:addr:python': 0.09; 'from:addr:mrabarnett.plus.com': 0.16; 'from:name:mrab': 0.16; 'message-id:@mrabarnett.plus.com': 0.16; 'received:84.92': 0.16; 'received:84.92.122': 0.16; 'received:84.92.122.60': 0.16; 'reply-to:addr:python-list': 0.16; 'subject:Language': 0.16; 'wolfgang': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.22; 'numeric': 0.23; 'compared': 0.28; 'constant': 0.29; 'there': 0.33; 'header:User-Agent:1': 0.33; 'received:84': 0.34; 'reply-to:addr:python.org': 0.34; 'to:addr :python-list': 0.35; 'none': 0.35; 'some': 0.38; 'doing': 0.38; 'should': 0.38; 'to:addr:python.org': 0.40; 'type': 0.61; 'subject:!': 0.66; 'limit': 0.67; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.72; 'sick': 0.73; 'subject:types': 0.84
X-CM-Score 0.00
X-CNFS-Analysis v=2.0 cv=ZvRv2qHG c=1 sm=1 a=0nF1XD0wxitMEM03M9B4ZQ==:17 a=qePWxsfFzlIA:10 a=vtgoN0PlrdMA:10 a=OUOv7kDek9cA:10 a=8nJEP1OIZ-IA:10 a=mP9HVpG2UlJYR9b46rUA:9 a=445XV-v-Zjx61KwvKm4A:7 a=wPNLvfGTeEIA:10 a=0nF1XD0wxitMEM03M9B4ZQ==:117
X-AUTH mrabarnett:2500
Date Sat, 25 Feb 2012 17:54:56 +0000
From MRAB <python@mrabarnett.plus.com>
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2
MIME-Version 1.0
To python-list@python.org
Subject Re: PyWart: Language missing maximum constant of numeric types!
References <8c2096d9-3cc2-4b64-8f11-c1d958d94243@x19g2000yqh.googlegroups.com> <4f48996b$0$6639$9b4e6d93@newsspool2.arcor-online.net>
In-Reply-To <4f48996b$0$6639$9b4e6d93@newsspool2.arcor-online.net>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To python-list@python.org
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://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 <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.159.1330192496.3037.python-list@python.org> (permalink)
Lines 26
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1330192496 news.xs4all.nl 6938 [2001:888:2000:d::a6]:33815
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:20858

Show key headers only | View raw


On 25/02/2012 08:18, Wolfgang Meiners wrote:
> Am 24.02.12 14:37, schrieb Rick Johnson:
>>  I get sick and tired of doing this!!!
>>
>>  if maxlength == UNLIMITED:
>>      allow_passage()
>>  elif len(string)>  maxlength:
>>      deny_passage()
>>
>>  What Python needs is some constant that can be compared to ANY numeric
>>  type and that constant will ALWAYS be larger!
>>
>>
>>
> If there is no limit for len(string), why not simply use
>
> # get_limit() returns None if there is no limit
> maxlength = get_limit()
> if maxlength and (len(string)<= maxlength):
>      allow_passage()
> else:
>      deny_passage()
>
That should be:

if maxlength is not None and len(string) <= maxlength:

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


Thread

PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-24 05:37 -0800
  Re: PyWart: Language missing maximum constant of numeric types! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-02-24 13:55 +0000
    Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-24 06:14 -0800
  Re: PyWart: Language missing maximum constant of numeric types! Neil Cerutti <neilc@norwich.edu> - 2012-02-24 14:25 +0000
    Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-24 07:25 -0800
    Re: PyWart: Language missing maximum constant of numeric types! Devin Jeanpierre <jeanpierreda@gmail.com> - 2012-02-24 12:32 -0500
    Re: PyWart: Language missing maximum constant of numeric types! Ian Kelly <ian.g.kelly@gmail.com> - 2012-02-24 18:26 -0700
  Re: PyWart: Language missing maximum constant of numeric types! Miki Tebeka <miki.tebeka@gmail.com> - 2012-02-24 06:39 -0800
    Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-24 07:18 -0800
  Re: PyWart: Language missing maximum constant of numeric types! Mel Wilson <mwilson@the-wire.com> - 2012-02-24 10:21 -0500
    Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-24 15:31 +0000
    Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-24 07:34 -0800
      Re: PyWart: Language missing maximum constant of numeric types! Michael Torrie <torriem@gmail.com> - 2012-02-24 09:23 -0700
        Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-24 22:45 +0000
      Re: PyWart: Language missing maximum constant of numeric types! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-02-24 16:59 +0000
      Re: PyWart: Language missing maximum constant of numeric types! Michael Torrie <torriem@gmail.com> - 2012-02-24 16:16 -0700
      Re: PyWart: Language missing maximum constant of numeric types! Chris Angelico <rosuav@gmail.com> - 2012-02-25 11:09 +1100
      Re: PyWart: Language missing maximum constant of numeric types! Mark Lawrence <breamoreboy@yahoo.co.uk> - 2012-02-25 00:35 +0000
        Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-25 12:25 -0800
      Re: PyWart: Language missing maximum constant of numeric types! MRAB <python@mrabarnett.plus.com> - 2012-02-25 00:37 +0000
      Re: PyWart: Language missing maximum constant of numeric types! Serhiy Storchaka <storchaka@gmail.com> - 2012-02-25 17:32 +0200
  Re: PyWart: Language missing maximum constant of numeric types! Fayaz Yusuf Khan <fayaz.yusuf.khan@gmail.com> - 2012-02-25 06:52 +0530
    Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-25 01:50 +0000
      Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-25 12:29 -0800
        Re: PyWart: Language missing maximum constant of numeric types! alex23 <wuwei23@gmail.com> - 2012-02-26 18:32 -0800
          Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-27 03:51 +0000
            Re: PyWart: Language missing maximum constant of numeric types! Chris Angelico <rosuav@gmail.com> - 2012-02-27 14:59 +1100
            Re: PyWart: Language missing maximum constant of numeric types! alex23 <wuwei23@gmail.com> - 2012-02-26 22:49 -0800
  Re: PyWart: Language missing maximum constant of numeric types! Wolfgang Meiners <WolfgangMeiners01@web.de> - 2012-02-25 09:18 +0100
    Re: PyWart: Language missing maximum constant of numeric types! MRAB <python@mrabarnett.plus.com> - 2012-02-25 17:54 +0000
      Re: PyWart: Language missing maximum constant of numeric types! Rick Johnson <rantingrickjohnson@gmail.com> - 2012-02-25 12:35 -0800
        Re: PyWart: Language missing maximum constant of numeric types! Wolfgang Meiners <WolfgangMeiners01@web.de> - 2012-02-26 14:16 +0100
          Re: PyWart: Language missing maximum constant of numeric types! Wolfgang Meiners <WolfgangMeiners01@web.de> - 2012-02-26 14:38 +0100
            Re: PyWart: Language missing maximum constant of numeric types! Arnaud Delobelle <arnodel@gmail.com> - 2012-02-26 13:44 +0000
          Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-26 13:50 +0000
          Re: PyWart: Language missing maximum constant of numeric types! Neil Cerutti <neilc@norwich.edu> - 2012-02-27 12:25 +0000
        Re: PyWart: Language missing maximum constant of numeric types! Jean-Michel Pichavant <jeanmichel@sequans.com> - 2012-02-27 12:55 +0100
      Re: PyWart: Language missing maximum constant of numeric types! Wolfgang Meiners <WolfgangMeiners01@web.de> - 2012-02-26 12:56 +0100
        Re: PyWart: Language missing maximum constant of numeric types! Chris Angelico <rosuav@gmail.com> - 2012-02-26 23:52 +1100
          Re: PyWart: Language missing maximum constant of numeric types! Wolfgang Meiners <WolfgangMeiners01@web.de> - 2012-02-26 14:32 +0100
        Re: PyWart: Language missing maximum constant of numeric types! Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2012-02-26 13:19 +0000

csiph-web