[Python] python 3.6 & The Case Against Python 3

Marco Santamaria marco.santamaria a gmail.com
Mer 23 Nov 2016 15:34:09 CET


Il giorno 23 novembre 2016 09:47, Pietro <peter.zamb a gmail.com> ha scritto:

> Giusto per darvi un'idea dice:
>
> *"I cannot teach Python 3 to total beginners because I don't want them to
> think they "suck at programming" when really it's Python 3's fault. That's
> simply not fair to them, so I have to teach Python 2 so they have the best
> chance at learning to code.*
> *[...]*
> *If you learn Python 2, then you can still work with all the legacy Python
> 2 code in existence until Python dies or you (hopefully) move on. But if
> you learn Python 3 then your future is very uncertain. You could really be
> learning a dead language and end up having to learn Python 2 anyway."*
>
> Voi come la vedete?
>

Le argomentazioni portate sinceramente non mi sembrano stare in piedi.

1. Come è stato detto, ormai la maggior parte delle librerie sono state
portate <http://py3readiness.org/> a Python 3. Quindi il futuro di Python 3
non è incerto, invece quello di Python 2 lo è <https://pythonclock.org/>.

2. Le stringhe sono più difficili da usare in Python 3 per un beginner?
Solo perché ci sono sistemi alternativi (e più potenti) per formattarle?
Piuttosto sono più facili perché non c'è una implicita conversione tra str
e unicode (con tutte le frustrazioni
<https://fedorahosted.org/releases/k/i/kitchen/docs/unicode-frustrations.html>
annesse e connesse)

3. Il fatto che "Python 3 Is Not Turing Complete" mi pare più una
provocazione che una cosa seria.

4. La critica a quelle che lui chiama "statically typed strings" mi pare
insensata. In sostanza si vede come negativo il fatto di non poter
concatenare bytes e str. Ma In Python 2 ottengo un TypeError anche se provo
a fare 1 + 'abc'. Il concetto di dynamic typing non significa che non ci
debba essere nessun controllo sui tipi a runtime.

I tre metodi per la formattazione delle stringhe sono apparentemente una
violazione dello Zen of Python. Ma in realtà il vecchio % è stato lasciato
solo per retrocompatibilità con l'intenzione di deprecarlo prima o poi
<https://www.python.org/dev/peps/pep-3101/>. E la PEP 0498 introduce una
sintassi che è in continuità con quella del format
<https://www.python.org/dev/peps/pep-0498/#rationale>, riducendone un po'
di boilerplate.

Personalmente è ormai da più di un anno che sono passato a Python 3 per
tutti i progetti nuovi senza problemi.

Marco
-- 
|_|0|_|
|_|_|0|
|0|0|0|
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20161123/50074615/attachment.html>


Maggiori informazioni sulla lista Python