delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to geda-user-bounces using -f |
X-Recipient: | geda-user AT delorie DOT com |
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:to | |
:content-type; | |
bh=Ci/YUDDAQoq3QflK7y4ncFICeRrivOFIx7L0Izc+BDo=; | |
b=0VJ+Z6LJb+0kXCsfQq2ZxtkoIEjtXS8XT+EkCGtAZTQaK7GEe7HSJg1ib+6HxB6Mux | |
vqlLJ9Ty6w3dlMGCUlDHSgnX0elfRyOlcgQYNTizXmk7AK7aaT5JLLhbeNnHCVQDuRgi | |
2YTwETUteWHpaZQ+lbCADo1K7VJqws0MqBuBL8zgW7tLjRKG3pJHZlPMoOEbQhGuyrCq | |
AlhcMcY7du2YZ6CucB1jijmDc9KLoIMpwdtC8oVXpTaiy0cxJLaopMlsS9tHX/PtnmQi | |
JmXBOmy/L25bQad0DdCdnBBqAnqxst0YZW+xXSalE2DAtNcg3ufbkahMubJXnNgvrbDo | |
0IMg== | |
MIME-Version: | 1.0 |
X-Received: | by 10.182.223.37 with SMTP id qr5mr2764781obc.41.1391373447648; |
Sun, 02 Feb 2014 12:37:27 -0800 (PST) | |
In-Reply-To: | <20140131220845.GA29613@visitor2.iram.es> |
References: | <CACPio-66SHLWYAusnwq0acYBL+QX0uwuuT8zeUotYE90a5pCHQ AT mail DOT gmail DOT com> |
<CAG4ve9KeBYS_Gs_5y2o6ZWVREq0tEFtJiEQbX692SbRzTdSxgw AT mail DOT gmail DOT com> | |
<CAG4ve9+wP0VAnXAFpB+gJQHUphnNTYn71_wBphuMafL09k9YnQ AT mail DOT gmail DOT com> | |
<koto2c$r5i$1 AT ger DOT gmane DOT org> | |
<CAG4ve9KJeGATHFoUuosCnOeUNa9TcunM1+C9EJwxAbTQ3yU0dw AT mail DOT gmail DOT com> | |
<kp224q$20f$1 AT ger DOT gmane DOT org> | |
<CAG4ve9+RgrKFe7-F13QxMqb4sx3jYqQuaFxwzPnVuayPq9U8fw AT mail DOT gmail DOT com> | |
<1391182300 DOT 2023 DOT 11 DOT camel AT AMD64X2 DOT fritz DOT box> | |
<CAG4ve9+JF25kq5xzZ0NyAF2cK2Sq_qBEUK742aj64ZrQmituWg AT mail DOT gmail DOT com> | |
<dcctraxft DOT ln2 AT skate DOT rswarbrick> | |
<20140131220845 DOT GA29613 AT visitor2 DOT iram DOT es> | |
Date: | Mon, 3 Feb 2014 00:37:27 +0400 |
Message-ID: | <CAG4ve9J=fW0yyAE5Qj2g7EjEDMo-ywhxtr+Sjhh_0SEtA7Gnmg@mail.gmail.com> |
Subject: | Re: [geda-user] Re: refdes renumber |
From: | =?KOI8-R?B?4czFy9PFyiDowdLYy8/X08vJyg==?= <svetonomer AT gmail DOT com> |
To: | geda-user AT delorie DOT com |
Reply-To: | geda-user AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | geda-user AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
--f46d0444ee6918de4904f1726038 Content-Type: text/plain; charset=ISO-8859-1 2014-02-01 Gabriel Paubert <paubert AT iram DOT es>: > > This said, there is another important point: for an array of n > elements, valid indices in Python are in the range from -n to > n-1. The range 0 to n-1 is the familiar zero-based indexing used in > C and other languages, negative indices run backwards from the > end of the array so a[-n] is the first element and a[-1] the last. > :) Python's interpreter variables types differs from types in C in "other languges", which use with compilers. Variable's memory organization if different too. Struct of variables (e.g. integer) on python is complex. This is similar of struct in C, even more similar of classes in Cpp. Indexes of LISTs (not arrays) may be [-N...N] . And this is not depend of usage arcitectures or low level memory organisation, but this depends and provides only python language standarts. Python will be work on IBM PC or any microcontrollers (e.g. ARM-based) absolutely equally. Indexes [-n] and etc. in python are transformed to expression: list[-m] => list [len(list)-m] And usage of this is very relaible. And if its not works - this is bug of python :) > > [Note that I don't think that this definition is a good idea: it > may hide bugs when you have a complex indexing expression which > is off by one and the Python interpreter will happily access the > last element of an array instead of throwing an exception for > out of bounds access. There are cases where it is handy but I am > of the strong opinion that it is more dangerous than useful.] > If you afraids of negative indexes, don't use python!! Use C, C++ and other languages... I using python and I will be using python because I see that it is convenient and flexible. Script now is available through web interface http://www.gedasymbols.org/user/alexey_kharikovskiy/ Does anyone need a gtk frontend? --f46d0444ee6918de4904f1726038 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><br><div class=3D"gmail= _quote">2014-02-01 Gabriel Paubert <span dir=3D"ltr"><<a href=3D"mailto:= paubert AT iram DOT es" target=3D"_blank">paubert AT iram DOT es</a>></span>:<br><bloc= kquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:= 1px solid rgb(204,204,204);padding-left:1ex"> <br> This said, there is another important point: for an array of n<br> elements, valid indices in Python are in the range from -n to<br> n-1. The range 0 to n-1 is the familiar zero-based indexing used in<br> C and other languages, negative indices run backwards from the<br> end of the array so a[-n] is the first element and a[-1] the last.<br></blo= ckquote><div><br>:)<br></div><div>Python's interpreter variables types = differs from types in C in "other languges", which use with compi= lers.<br> </div><div>Variable's memory organization if different too.<br></div><d= iv>Struct of variables (e.g. integer) on python is complex. This is similar= of struct in C, even more similar of classes in Cpp.<br></div><div>Indexes= of LISTs (not arrays) may be [-N...N] . And this is not depend of usage ar= citectures or low level memory organisation, but this depends and provides = only python language standarts.<br> </div><div>Python will be work on IBM PC or any microcontrollers (e.g. ARM-= based) absolutely equally.<br></div><div>Indexes [-n] and etc. in python ar= e transformed to expression:<br>list[-m] =3D> list [len(list)-m]<br></di= v> <div>And usage of this is very relaible. And if its not works - this is bug= of python :)<br></div><div>=A0<br></div><blockquote class=3D"gmail_quote" = style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa= dding-left:1ex"> <br> [Note that I don't think that this definition is a good idea: it<br> may hide bugs when you have a complex indexing expression which<br> is off by one and the Python interpreter will happily access the<br> last element of an array instead of throwing an exception for<br> out of bounds access. There are cases where it is handy but I am<br> of the strong opinion that it is more dangerous than useful.]<br></blockquo= te><div>If you afraids of negative indexes, don't use python!!<br></div= ><div>Use C, C++ and other languages...<br></div><div>I using python and I<= span id=3D"result_box" class=3D"" lang=3D"en"><span class=3D""> will be usi= ng python</span></span><span id=3D"result_box" class=3D"" lang=3D"en"><span= class=3D""> because</span> <span class=3D"">I see that</span> <span class= =3D"">it is convenient and </span></span><span id=3D"result_box" class=3D""= lang=3D"en"><span class=3D""><span id=3D"result_box" class=3D"" lang=3D"en= "><span class=3D"">flexible</span></span>. <br> </span></span></div><div><span id=3D"result_box" class=3D"" lang=3D"en"><sp= an class=3D""><br><br></span></span></div><div><span id=3D"result_box" clas= s=3D"" lang=3D"en"><span class=3D"">Script now is available through web int= erface<br><a href=3D"http://www.gedasymbols.org/user/alexey_kharikovskiy/">= http://www.gedasymbols.org/user/alexey_kharikovskiy/</a><br> </span></span></div><div><span id=3D"result_box" class=3D"" lang=3D"en"><sp= an class=3D""><br></span></span><br><span id=3D"result_box" class=3D"" lang= =3D"en"><span class=3D"">Does</span> <span class=3D"">anyone</span> <span c= lass=3D"">need a</span> <span class=3D"">gtk frontend?</span></span></div> </div></div></div> --f46d0444ee6918de4904f1726038--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |