_marker.py 543 B

12345678910111213141516171819
  1. # -*- coding: utf-8 -*-
  2. # Copyright 2018 Joshua Bronson. All Rights Reserved.
  3. #
  4. # This Source Code Form is subject to the terms of the Mozilla Public
  5. # License, v. 2.0. If a copy of the MPL was not distributed with this
  6. # file, You can obtain one at http://mozilla.org/MPL/2.0/.
  7. """Provides :class:`_Marker`, an internal type for representing singletons."""
  8. from collections import namedtuple
  9. class _Marker(namedtuple('_Marker', 'name')):
  10. __slots__ = ()
  11. def __repr__(self):
  12. return '<%s>' % self.name # pragma: no cover