Re: [Python] Migrazione da 2 a 3.

2015-07-16 Thread Giampaolo Rodola'
2015-07-15 16:37 GMT+02:00 Nicola Larosa :

> > Gabriele Battaglia ha scritto:
> >> Ricevo un errore di sintassi su un confronto:
> >>
> >> if x <> 0:
>
> Riccardo Magliocchetti wrote:
> > E` la prima volta che vedo quella sintassi in Python :)
> >
> > The forms <> and != are equivalent; for consistency with C, != is
> > preferred; where != is mentioned below <> is also accepted. The <>
> > spelling is considered obsolescent.
> >
> > Questo dalla doc di python 2.4 che ha più di 10 anni. Quanto vecchia è
> > la tua codebase? ;)
>
> Magari sta lavorando su Mailman, le battaglie di Barry Warsaw su questo
> punto sono rimaste nella leggenda. :-)
>

Cioè? :D

-- 
Giampaolo - http://grodola.blogspot.com
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Gabriele Battaglia

> Il giorno 15/lug/2015, alle ore 16:35, Carlo Miron  ha 
> scritto:
> 
> 2015-07-15 15:59 GMT+02:00 Gabriele Battaglia :
> 
>> Ricevo un errore di sintassi su un confronto:
>> if x <> 0:
> 
> In questo caso esistono due soluzioni, lascio a te il decidere qual è
> Quella Giusta™:
> 
> * usi la forma corretta `!=` invece del diamante (`<>`)
> * aggiungi in cima allo script `from __future__ import barry_as_FLUFL`
Wow, come si fa la faccina che arrossisce di vergogna! Le mie povere 
rimembranze di basic anni 90… :)
Ad ogni modo, la prima è quella corretta, ma la seconda è più divertente e vado 
subito a vedere cosa fa quel modulo… Quale altra strana sintassi consente. :)
GB.
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Gabriele Battaglia

> Il giorno 15/lug/2015, alle ore 16:33, Riccardo Magliocchetti 
>  ha scritto:
> 
> Il 15/07/2015 15:59, Gabriele Battaglia ha scritto:
>> Ricevo un errore di sintassi su un confronto:
>> 
>> if x <> 0:
> 
> E` la prima volta che vedo quella sintassi in Python :)
> 
> The forms <> and != are equivalent; for consistency with C, != is preferred;
> where != is mentioned below <> is also accepted. The <> spelling is considered
> obsolescent.
> 
> Questo dalla doc di python 2.4 che ha più di 10 anni. Quanto vecchia è la tua 
> codebase? ;)
> Non Due, meglio che tu non lo sappia: gli pterodattili solcavano ancora i 
> cieli del pleistocene.
GB.

___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Nicola Larosa
> Gabriele Battaglia ha scritto:
>> Ricevo un errore di sintassi su un confronto:
>> 
>> if x <> 0:

Riccardo Magliocchetti wrote:
> E` la prima volta che vedo quella sintassi in Python :)
> 
> The forms <> and != are equivalent; for consistency with C, != is
> preferred; where != is mentioned below <> is also accepted. The <>
> spelling is considered obsolescent.
> 
> Questo dalla doc di python 2.4 che ha più di 10 anni. Quanto vecchia è
> la tua codebase? ;)

Magari sta lavorando su Mailman, le battaglie di Barry Warsaw su questo
punto sono rimaste nella leggenda. :-)

-- 
Nicola 'tekNico' Larosa 
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Carlo Miron
2015-07-15 15:59 GMT+02:00 Gabriele Battaglia :

> Ricevo un errore di sintassi su un confronto:
> if x <> 0:

In questo caso esistono due soluzioni, lascio a te il decidere qual è
Quella Giusta™:

* usi la forma corretta `!=` invece del diamante (`<>`)
* aggiungi in cima allo script `from __future__ import barry_as_FLUFL`

©

-- 
|:**THE BEER-WARE LICENSE** (Revision 42):
|  wrote this mail. As long as you retain
| this notice you can do whatever you want with this stuff.
| If we meet some day, and you think this stuff is worth it,
| you can buy me a beer in return.
|--Carlo Miron :
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Riccardo Magliocchetti

Il 15/07/2015 15:59, Gabriele Battaglia ha scritto:

Ricevo un errore di sintassi su un confronto:

if x <> 0:


E` la prima volta che vedo quella sintassi in Python :)

The forms <> and != are equivalent; for consistency with C, != is preferred;
where != is mentioned below <> is also accepted. The <> spelling is considered
obsolescent.

Questo dalla doc di python 2.4 che ha più di 10 anni. Quanto vecchia è la tua 
codebase? ;)


--
Riccardo Magliocchetti
@rmistaken

http://menodizero.it
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


Re: [Python] Migrazione da 2 a 3.

2015-07-15 Thread Davide Muzzarelli

Il 15/07/2015 15:59, Gabriele Battaglia ha scritto:

Chiedo una vostra opinione, cosa mi consigliereste, quale lettura, per
un primo e non completo sguardo alle differenze fra python 2 e 3?
[...]
Ecco, dov'è la miglior lista di tutti questi piccoli cambiamenti...
senza la pretesa di un documento completo, giusto per un primo assaggio.


Ciao Gabriele,
vai sulla documentazione di Python (es. https://docs.python.org/3/) e 
leggi il capitolo "What's New In Python 3.4". Lì troverai tutte le 
differenze spiegate in maniera egregia.


https://docs.python.org/3/whatsnew/3.0.html
https://docs.python.org/3/whatsnew/3.1.html
https://docs.python.org/3/whatsnew/3.2.html
https://docs.python.org/3/whatsnew/3.3.html
https://docs.python.org/3/whatsnew/3.4.html

Byez,
Davide Muzzarelli
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python


[Python] Migrazione da 2 a 3.

2015-07-15 Thread Gabriele Battaglia

dovrebbero essere un bel po, sparse qua e là per la rete...

Chiedo una vostra opinione, cosa mi consigliereste, quale lettura, per 
un primo e non completo sguardo alle differenze fra python 2 e 3?
Ho appena installato l'ultima rilasciata, ad esempio, la 3.4.3 ed ho 
provato ad eseguire uno script:

Ricevo un errore di sintassi su un confronto:

if x <> 0:

Ecco, dov'è la miglior lista di tutti questi piccoli cambiamenti... 
senza la pretesa di un documento completo, giusto per un primo assaggio.


Grazie come sempre.
GB.
___
Python mailing list
Python@lists.python.it
http://lists.python.it/mailman/listinfo/python