Domande taggate «typeerror»

7
super () genera "TypeError: deve essere type, non classobj" per la classe new-style
Il seguente uso di super()genera un TypeError: perché? >>> from HTMLParser import HTMLParser >>> class TextParser(HTMLParser): ... def __init__(self): ... super(TextParser, self).__init__() ... self.all_data = [] ... >>> TextParser() (...) TypeError: must be type, not classobj C'è una domanda simile su StackOverflow: Python super () genera TypeError , dove l'errore …



10
"TypeError: (Integer) non è serializzabile JSON" durante la serializzazione di JSON in Python?
Sto cercando di inviare un semplice dizionario a un file JSON da Python, ma continuo a ricevere il messaggio "TypeError: 1425 non è serializzabile JSON". import json alerts = {'upper':[1425],'lower':[576],'level':[2],'datetime':['2012-08-08 15:30']} afile = open('test.json','w') afile.write(json.dumps(alerts,encoding='UTF-8')) afile.close() Se aggiungo l'argomento predefinito, allora scrive, ma i valori interi vengono scritti nel file …



3
"Uncaught TypeError: Illegal invocation" in Chrome
Quando utilizzo requestAnimationFrameuna animazione nativa supportata con il codice seguente: var support = { animationFrame: window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame }; support.animationFrame(function() {}); //error support.animationFrame.call(window, function() {}); //right Chiamando direttamente il support.animationFramesarà dato ... Uncaught TypeError: invocazione illegale in Chrome. Perché?

7
Uncaught TypeError: (valore intermedio) (…) non è una funzione
Tutto funziona bene quando ho scritto la logica js in una chiusura come un singolo file js, come: (function(win){ //main logic here win.expose1 = .... win.expose2 = .... })(window) ma quando provo a inserire una funzione alternativa di registrazione prima di quella chiusura nello stesso file js, window.Glog = function(msg){ …

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.