Duda sobre codigo en interfaz grafica

Hola. Soy muy nuevo en esto de la programacion en Python.
Tengo una duda sobre un codigo:

from tkinter import ttk
import tkinter as tk
 
 
class CheckbuttonForEntry(ttk.Checkbutton):
    """
    Checkbutton para deshabilitar un Entry.
    """
    def __init__(self, *args, **kwargs):
        self._var = tk.BooleanVar(value=True)
        kwargs["variable"] = self._var
        self.entry = kwargs.pop("entry")
        super().__init__(*args, **kwargs)
        self.config(command=self.clicked)
    
    def clicked(self):
        entry.config(state=tk.NORMAL if self._var.get() else tk.DISABLED)
 
 
root = tk.Tk()
entry = ttk.Entry()
checkbutton = CheckbuttonForEntry(
    text="Entry activado",
    entry=entry
)
entry2 = ttk.Entry()
checkbutton2 = CheckbuttonForEntry(
    text="Entry2 activado",
    entry=entry2
)
checkbutton.grid(row=0,column=0)
entry.grid(row=2, column=1)
checkbutton2.grid(row=1,column=0)
entry2.grid(row=3, column=1)
 
root.mainloop()

* root.mainloop()

de este codigo, que sirve para que cada checkbutton habilite o deshabilite a un entry, no comprendo la parte de inicializacion de la subclase de checkbutton

 def __init__(self, *args, **kwargs):
        self._var = tk.BooleanVar(value=True)
        kwargs["variable"] = self._var
        self.entry = kwargs.pop("entry")
        super().__init__(*args, **kwargs)
        self.config(command=self.clicked)

si alguien pudiera explicarlo, o indicarme donde leer algo al respecto, lo agradezco.
Saludos

Está escrito de una forma muy fea, podría ser mucho más pythónico:

    def __init__(self, text, entry):
        self._var = tk.BooleanVar(value=True)
        self.entry = entry
        super().__init__(text=text, variable=self._var)
        self.config(command=self.clicked)

Ya que estamos, tiene un bug en el código del método, debería ser:

    def clicked(self):
        self.entry.config(state=tk.NORMAL if self._var.get() else tk.DISABLED)

Hola Facundo. Gracias por responder.
El bug lo noté después, es cierto.

Respecto de lo demas, sigo sin comprender mucho como funciona esa inicializacion.
Si se pudiera explicar, lo agradezco
Saludos