Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.freenet.ag!news2.euro.net!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; 'true,': 0.04; 'subject:Python': 0.05; '-0500': 0.07; 'compute': 0.09; 'way:': 0.09; 'def': 0.10; 'suggest': 0.11; 'sat,': 0.15; 'subject:Issue': 0.17; 'feb': 0.19; 'email addr:gmail.com>': 0.20; "i'd": 0.22; 'cc:2**0': 0.23; '>': 0.23; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.25; '----------': 0.26; 'coding': 0.27; 'message-id:@mail.gmail.com': 0.27; 'received:209.85.212': 0.28; 'subject:list': 0.28; 'run': 0.28; '+0100,': 0.29; 'date:': 0.29; 'definition': 0.29; 'function': 0.30; 'code': 0.31; 'suggestion': 0.32; 'function.': 0.33; 'url:home': 0.33; 'to:addr:python-list': 0.33; 'hi,': 0.33; 'received:google.com': 0.34; 'minimum': 0.34; 'data,': 0.35; 'received:209.85': 0.35; 'subject:': 0.36; 'email addr:python.org': 0.36; 'should': 0.36; 'rather': 0.37; 'received:209': 0.37; 'subject:: ': 0.38; 'from:': 0.38; 'some': 0.38; 'forwarded': 0.38; 'to:addr:python.org': 0.39; 'subject:-': 0.40; 'your': 0.60; 'subject:, ': 0.61; 'email name:python-list': 0.62; 'goal': 0.74; '2013': 0.84; 'cc:addr:ix.netcom.com': 0.84; 'dennis': 0.91 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:in-reply-to:references:date:message-id :subject:from:to:cc:content-type; bh=kClxMQyX+rozMYL1MAScXl/2pSi3Om7knxefHpWeQV4=; b=UCaa3RgYUDFFHFiFW+iXQarR/3Gemm+Qnw0N/u9/QHxAsD780K3aBEQ0PkJfAA43e9 A+9uLROngHspztdP42EWLE3PAFRcV6NpkrnwSkwB+VRcbXhkSpKhgZHl0RGUHFyIfdvj LGiniYsZYsJAFtGlixzvoJSQ14TYn35Pcx9PGy/0olDnJFZ8xWItwTPwbSitCMB1Yy7S +solX0Ml5wFBDfWt2hgydOsX2Nd4sNMptfjW0rwtvmedXhcrcpNjCQMZxuB4XAVtm8l9 xzvkcoirGfe0NYtNW5lR1+gf1T8sT3JGsSx9M6nDm6rvZ7ab0QcniNBaNDTIWNREDLdV 6KMA== MIME-Version: 1.0 X-Received: by 10.180.84.162 with SMTP id a2mr4289262wiz.14.1361659678880; Sat, 23 Feb 2013 14:47:58 -0800 (PST) In-Reply-To: References: Date: Sat, 23 Feb 2013 23:47:58 +0100 Subject: Re: Python-list Digest, Vol 113, Issue 192 From: Morten Engvoldsen To: python-list@python.org Content-Type: multipart/alternative; boundary=f46d044271947729d004d66c19d0 Cc: wlfraed@ix.netcom.com 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: 87 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1361659685 news.xs4all.nl 6921 [2001:888:2000:d::a6]:33007 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:39716 --f46d044271947729d004d66c19d0 Content-Type: text/plain; charset=ISO-8859-1 Hi, Okey i will change the function name :) Do you have any suggestion to generate the weight at run time rather than hard coding it... > > ---------- Forwarded message ---------- > From: Dennis Lee Bieber > To: python-list@python.org > Cc: > Date: Sat, 23 Feb 2013 14:03:23 -0500 > Subject: Re: Number validation issue > On Sat, 23 Feb 2013 10:11:04 +0100, Morten Engvoldsen > declaimed the following in > gmane.comp.python.general: > > > > > > > Hi, > > > > > Yes true, i need to generate weight at run time rather than hard coding > it, > > following are some solution: > > > > Since the max length of thenumber should be 25 and minimum should be 2 so > > code will be in this way: > > > > def is_valid_isbn13(isbn13): > > Isn't an ISBN13 -- by definition -- 13 digits (ignoring hyphens). > > If your goal is to compute a checksum for a non-fixed length of > data, I'd suggest changing the name of the function. > -- > Wulfraed Dennis Lee Bieber AF6VN > wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/ > > --f46d044271947729d004d66c19d0 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi,
Okey i will change the function name :) Do you have any suggestion t= o generate the weight at run time rather than hard coding it...

---------- Forwarded message ----------
From:=A0Dennis Lee Bieber &l= t;wlfraed@ix.netcom.com>To:=A0python-list@python.org=
Cc:=A0
Date:=A0Sat, 23 Feb 2013 14:03:23 -0500
Subject:=A0Re: Number = validation issue
On Sat, 23 Feb 2013 10:11:04 +0100, Morten Engvoldsen <mortenengv@gmail.com> de= claimed the following in
gmane.comp.python.general:

> >
> > Hi,
> >
> =A0Yes true, i need to generate weight at run time rather than hard co= ding it,
> following are some solution:
>
> Since the max length of thenumber should be 25 and minimum should be 2= so
> code will be in this way:
>
> def is_valid_isbn13(isbn13):

=A0 =A0 =A0 =A0 Isn't an ISBN13 -- by definition -- 13 digits (ignoring= hyphens).

=A0 =A0 =A0 =A0 If your goal is to compute a checksum for a non-fixed lengt= h of
data, I'd suggest changing the name of the function.
--
=A0 =A0 =A0 =A0 Wulfraed =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Dennis Lee Bieber = =A0 =A0 =A0 =A0 AF6VN
=A0 =A0 =A0 =A0 wlfraed@ix.netcom.= com =A0 =A0HTTP://wlfraed.home.netcom.com/


--f46d044271947729d004d66c19d0--