← Back
Editing: strdispatch.cpython-311.pyc
� �@�c. � �: � d Z ddlZddlmZ G d� de� � ZdS )z>String dispatch class to match regexps and dispatch commands. � N)�CommandChainDispatcherc �@ � e Zd ZdZd� Zdd�Zdd�Zd� Zd� Zd� Z d � Z d S )�StrDispatcha Dispatch (lookup) a set of strings / regexps for match. Example: >>> dis = StrDispatch() >>> dis.add_s('hei',34, priority = 4) >>> dis.add_s('hei',123, priority = 2) >>> dis.add_re('h.i', 686) >>> print(list(dis.flat_matches('hei'))) [123, 34, 686] c �"