<br clear="all"><span class="Apple-style-span" style="font-family: arial, sans-serif; "><span class="hps" title="Clique para mostrar traduções alternativas">I</span> <span class="hps" title="Clique para mostrar traduções alternativas">thought about</span> <span class="hps" title="Clique para mostrar traduções alternativas">how to</span> <span class="hps" title="Clique para mostrar traduções alternativas">do</span> <span class="hps" title="Clique para mostrar traduções alternativas">but</span> <span class="hps" title="Clique para mostrar traduções alternativas">did not analyze</span> <span class="hps" title="Clique para mostrar traduções alternativas">the</span> <span class="hps" title="Clique para mostrar traduções alternativas">feasibility, sorry about that</span><span title="Clique para mostrar traduções alternativas">.</span> <span class="hps" title="Clique para mostrar traduções alternativas">It could</span> <span class="hps" title="Clique para mostrar traduções alternativas">be</span> <span class="hps" title="Clique para mostrar traduções alternativas">after</span> <span class="hps" title="Clique para mostrar traduções alternativas">the</span> <span class="hps" title="Clique para mostrar traduções alternativas">symbol</span><span class="hps" title="Clique para mostrar traduções alternativas">']</span><span title="Clique para mostrar traduções alternativas" class="">'and</span> <span class="hps" title="Clique para mostrar traduções alternativas">')'.</span> <span class="hps" title="Clique para mostrar traduções alternativas">So</span> <span class="hps" title="Clique para mostrar traduções alternativas">would</span><span title="Clique para mostrar traduções alternativas">:</span></span><br>
<div><br></div><div><span class="Apple-style-span" style="border-collapse: collapse; color: rgb(80, 0, 80); font-family: arial, sans-serif; ">>>> var1 = [1, 2, 3]i # a singletype int list, as a current array<br>
>>> var2 = ('1', '2', '3')i # a singletype int tuple, as a current<br>
>>> array, but immutable</span><br><br>Até mais!<br>Ass.: Arthur Julião<br>------------------------------------------------------------------------------------------------<br>"Quero que a estrada venha sempre até você e que o vento esteja sempre a seu favor, quero que haja sempre uma cerveja em sua mão e que esteja ao seu lado seu grande amor." (Tempo Ruim - A Arte do Insulto - Matanza)<br>
<br><br><div class="gmail_quote">2011/2/8 Nick Coghlan <span dir="ltr"><<a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, Feb 8, 2011 at 9:52 PM, Arthur <<a href="mailto:azrael.zila@gmail.com">azrael.zila@gmail.com</a>> wrote:<br>
> Thus, the variable "var" is a list, not a tuple, even if it<br>
> is declared with with a tuple instead of a list:<br>
>>>> var = array('i',(1,2,3))<br>
>>>> var<br>
> array('i', [1, 2, 3])<br>
<br>
</div>Note that an array is its own beast - it just happens to use list<br>
notation in its repr, as the square brackets contrast better with the<br>
parentheses used for the function call syntax.<br>
<br>
Regardless, if you want a quick and easy way to create arrays of<br>
particular types, just define your own constructor function:<br>
<br>
>>> from array import array<br>
>>> def iarray(*elements):<br>
... return array('i', elements)<br>
...<br>
>>> x = iarray(1, 2, 3)<br>
>>> x<br>
<div class="im">array('i', [1, 2, 3])<br>
<br>
</div>Cheers,<br>
Nick.<br>
<font color="#888888"><br>
--<br>
Nick Coghlan | <a href="mailto:ncoghlan@gmail.com">ncoghlan@gmail.com</a> | Brisbane, Australia<br>
</font></blockquote></div><br></div>