def count_attached(mol):
    """
    Counts the number of atoms labelled 'attached'.

    Parameters
    ----------
    mol : :class:`rdkit.Chem.rdchem.Mol`
        A molecule to have 'attached' atoms counted.

    Returns
    -------
    :class:`int`
        The number of atoms with the property 'attached' in `mol`.

    """

    return sum(1 for a in mol.GetAtoms() if a.HasProp('attached'))