samedi 12 juin 2021

I am getting a warning(mentioned at last of my code) while using python 3.6 interpreter, I remember making this in 3.7 and no error occured back then

import random

class Logic:

def __init__(self):
    super().__init__()

    self.actual = [[0 for _ in range(8)] for _ in range(10)]
    self.danger()

def danger(self):
    p = random.randint(0, 9)
    q = random.randint(0, 7)

    self.actual[p][q] = '#'

parameter q in the last line shows this error :

Unexpected type(s): (int, str) Possible type(s): (_SupportsIndex, int) (slice, Iterable[int]) 
 Inspection info: This inspection detects type errors in function call expressions. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Types of function parameters can be specified in docstrings or in Python 3 function annotations.



Aucun commentaire:

Enregistrer un commentaire