Preguntas etiquetadas con typeerror

7
super () plantea "TypeError: debe ser type, no classobj" para la clase de estilo nuevo
El siguiente uso de super()plantea un error de tipo: ¿por qué? >>> from HTMLParser import HTMLParser >>> class TextParser(HTMLParser): ... def __init__(self): ... super(TextParser, self).__init__() ... self.all_data = [] ... >>> TextParser() (...) TypeError: must be type, not classobj Hay una pregunta similar en StackOverflow: Python super () plantea TypeError …



10
"TypeError: (Integer) no es serializable JSON" al serializar JSON en Python?
Estoy tratando de enviar un diccionario simple a un archivo json desde python, pero sigo recibiendo el mensaje "TypeError: 1425 no es serializable 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() Si agrego el argumento predeterminado, escribe, pero los valores enteros se escriben en el archivo …



3
"Error de tipo no detectado: invocación ilegal" en Chrome
Cuando solía requestAnimationFramehacer una animación nativa compatible con el siguiente código: var support = { animationFrame: window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame }; support.animationFrame(function() {}); //error support.animationFrame.call(window, function() {}); //right Llamar directamente a la support.animationFramevoluntad dará ... TypeError no capturado: invocación ilegal en cromo ¿Por qué?



Al usar nuestro sitio, usted reconoce que ha leído y comprende nuestra Política de Cookies y Política de Privacidad.
Licensed under cc by-sa 3.0 with attribution required.