Domande taggate «python-2.x»

Per domande sulla programmazione Python specifiche della versione 2.x della lingua. Utilizzare il tag [tag: python] più generico se la domanda non è specifica della versione.






4
Python super () solleva TypeError
In Python 2.5, il codice seguente genera un TypeError: >>> class X: def a(self): print "a" >>> class Y(X): def a(self): super(Y,self).a() print "b" >>> c = Y() >>> c.a() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 3, in a TypeError: super() argument …

4
Associatività di "in" in Python?
Sto creando un parser Python e questo mi confonde davvero : >>> 1 in [] in 'a' False >>> (1 in []) in 'a' TypeError: 'in <string>' requires string as left operand, not bool >>> 1 in ([] in 'a') TypeError: 'in <string>' requires string as left operand, not list …






1
Brew - reinstallazione di python @ 2
Ho avuto problemi con openssl e python @ 2 con brew, che ho spiegato qui (non risolto) . La soluzione documentata per reinstallare Python e openssl non funzionava, quindi ho deciso di disinstallare e reinstallare Python. Il problema è che quando tenti di installare Python 2 con brew, ricevi questo …
Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.