Callable which returns a :class:`.BakedQuery`. This object is returned by the class method :meth:`.BakedQuery.bakery`. It exists as an object so that the "cache" can be easily inspected. .. versionadded:: 1.2
| 32 | |
| 33 | |
| 34 | class Bakery: |
| 35 | """Callable which returns a :class:`.BakedQuery`. |
| 36 | |
| 37 | This object is returned by the class method |
| 38 | :meth:`.BakedQuery.bakery`. It exists as an object |
| 39 | so that the "cache" can be easily inspected. |
| 40 | |
| 41 | .. versionadded:: 1.2 |
| 42 | |
| 43 | |
| 44 | """ |
| 45 | |
| 46 | __slots__ = "cls", "cache" |
| 47 | |
| 48 | def __init__(self, cls_, cache): |
| 49 | self.cls = cls_ |
| 50 | self.cache = cache |
| 51 | |
| 52 | def __call__(self, initial_fn, *args): |
| 53 | return self.cls(self.cache, initial_fn, args) |
| 54 | |
| 55 | |
| 56 | class BakedQuery: |