Perguntas com a marcação «typeerror»

7
super () gera "TypeError: deve ser do tipo, não classobj" para a classe de novo estilo
O seguinte uso de super()gera um TypeError: 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 Há uma pergunta semelhante no StackOverflow: Python super () gera TypeError , onde …



10
"TypeError: (Inteiro) não é JSON serializável" ao serializar JSON em Python?
Estou tentando enviar um dicionário simples para um arquivo json a partir de python, mas continuo recebendo a mensagem "TypeError: 1425 is not JSON serializable". 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 eu adicionar o argumento padrão, ele gravará, mas os valores inteiros serão gravados …



3
“TypeError não capturado: invocação ilegal” no Chrome
Quando uso requestAnimationFramepara fazer alguma animação nativa suportada com o código abaixo: var support = { animationFrame: window.requestAnimationFrame || window.mozRequestAnimationFrame || window.webkitRequestAnimationFrame || window.msRequestAnimationFrame || window.oRequestAnimationFrame }; support.animationFrame(function() {}); //error support.animationFrame.call(window, function() {}); //right Diretamente chamando o support.animationFramedará ... Tipo não detectadoErro: invocação ilegal no Chrome. Por quê?


Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.