We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent bc01cb6 commit 07743d9Copy full SHA for 07743d9
2 files changed
src/pkgcraft/pkg/base.pxd
@@ -1,10 +1,13 @@
1
from .. cimport pkgcraft_c as C
2
+from ..eapi cimport Eapi
3
from ..error cimport _IndirectInit
4
5
6
cdef class Pkg(_IndirectInit):
7
cdef C.Pkg *ptr
8
+
9
# cached fields
10
+ cdef Eapi _eapi
11
cdef int _hash
12
13
@staticmethod
src/pkgcraft/pkg/base.pyx
@@ -34,7 +34,9 @@ cdef class Pkg(_IndirectInit):
34
@property
35
def eapi(self):
36
"""Get a package's EAPI."""
37
- return Eapi.from_ptr(C.pkgcraft_pkg_eapi(self.ptr))
+ if self._eapi is None:
38
+ self._eapi = Eapi.from_ptr(C.pkgcraft_pkg_eapi(self.ptr))
39
+ return self._eapi
40
41
42
def repo(self):
0 commit comments