Use one custom property to limit another?

I’d like to set these up so Spoke size can never be larger than subdivisions, but when I try using the variable subs in place of the number 46 in the spoke variable, I get NameError: name 'subs' is not defined

Is it even possible to do this, or is it that I’m just missing syntax, or…?

image

    subs : IntProperty(name = "Subdivisions", 
        description = "Splits each individual 'spoke' or 'pie slice' into more slices", 
        default = 12, 
        min = 1, 
        max = 48
    )
    spoke : IntProperty(name = "Spoke Size", 
        description = "Enlarges spokes to help visualize rim elements", 
        default = 8, 
        min = 0,
        max = 46 #I've tried replacing this with subs, or self.subs, to no avail
    )

Might be a better way ,but this seems to work.

    def currentSubs(self, context):
        if self.spoke > self.subs:
            self.spoke = self.subs
                     
    subs : bpy.props.IntProperty(name = "Subdivisions", 
        description = "Splits each individual 'spoke' or 'pie slice' into more slices", 
        default = 12, 
        min = 1, 
        max = 48
    )
    
    spoke : bpy.props.IntProperty(name = "Spoke Size", 
        description = "Enlarges spokes to help visualize rim elements", 
        default = 8, 
        min = 0,
        max = 46,
        update = currentSubs        
    )

Yep, yep, that works, as long as I throw that update line in both fields it updates whenever I adjust subs or spokes. And this fixed another issue on another couple of custom properties where I needed to limit thickness based on another parameter. Cool, simple solution, works great.