chg: [type] Changed the way variables in some funtions are typed.

This commit is contained in:
Cédric Bonhomme 2023-05-21 10:30:11 +02:00
parent c12b371e7d
commit bc9b91e983
No known key found for this signature in database
GPG key ID: A1CB94DE57B7A70D

View file

@ -1,6 +1,4 @@
#!/usr/bin/env python #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Stegano - Stegano is a pure Python steganography module. # Stegano - Stegano is a pure Python steganography module.
# Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org # Copyright (C) 2010-2022 Cédric Bonhomme - https://www.cedricbonhomme.org
# #
@ -36,7 +34,7 @@ def steganalyse(img):
Steganlysis of the LSB technique. Steganlysis of the LSB technique.
""" """
width, height = img.size width, height = img.size
colours_counter = Counter() # type: typing.Counter[int] colours_counter: typing.Counter[int] = Counter()
for row in range(height): for row in range(height):
for col in range(width): for col in range(width):
r, g, b = img.getpixel((col, row)) r, g, b = img.getpixel((col, row))
@ -47,7 +45,7 @@ def steganalyse(img):
sorted(list(colours_counter.items()), key=lambda t: t[1]) sorted(list(colours_counter.items()), key=lambda t: t[1])
) )
colours = 0 # type: float colours: float = 0
for colour in list(dict_colours.keys()): for colour in list(dict_colours.keys()):
colours += colour colours += colour
colours = colours / len(dict_colours) colours = colours / len(dict_colours)