3 Klf! @ sb d Z ddlZddlmZ ddlmZ ddlmZ G dd dejZG d d d ZG dd dZ dS ) zI Classes and algorithms for matching requested access to access vectors. N )access)objectmodel)utilc @ s e Zd ZdddZdd ZdS )MatchNr c C s || _ || _d| _d | _d S )NF) interfacedistinfo_dir_change__hash__)selfr r r /usr/lib/python3.6/matching.py__init__ s zMatch.__init__c C s@ y"| j | jf}|j |jf}|||S ttfk r: tS X d S )N)r r AttributeError TypeErrorNotImplemented)r othermethodabr r r _compare( s zMatch._compare)Nr )__name__ __module____qualname__r r r r r r r s r c @ sH e Zd ZdZdd Zdd Zdd Zdd Zd d Zdd Z dd Z dS ) MatchList c C s$ g | _ g | _| j| _d| _d | _d S )NF)childrenbastardsDEFAULT_THRESHOLD thresholdallow_info_dir_changeav)r r r r r 3 s zMatchList.__init__c C s, t | jr| jd S t | jr(| jd S d S )Nr )lenr r )r r r r best<