コード例 #1
0
ファイル: weakref.py プロジェクト: M31MOTH/cpython
 def keys(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for k, wr in self.data.items():
             if wr() is not None:
                 yield k
コード例 #2
0
    def iter_instances(self):
        """Iterate over the stored objects

        .. seealso:: :meth:`pydispatch.utils.WeakMethodContainer.iter_instances`
        """
        with _IterationGuard(self):
            yield from super().iter_instances()
コード例 #3
0
ファイル: weakref.py プロジェクト: Jonator3/SnakeParty
 def keys(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for k, wr in self.data.items():
             if wr() is not None:
                 yield k
コード例 #4
0
ファイル: weakref.py プロジェクト: dbdoer/godwill
 def items(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for k, wr in list(self.data.items()):
             v = wr()
             if v is not None:
                 yield k, v
コード例 #5
0
ファイル: weakref.py プロジェクト: kubaszostak/gdal-dragndrop
 def iteritems(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for wr in self.data.itervalues():
             value = wr()
             if value is not None:
                 yield wr.key, value
コード例 #6
0
    def iterkeys(self):
        with _IterationGuard(self):
            for wr in self.data.iterkeys():
                obj = wr()
                if obj is not None:
                    yield obj

        return
コード例 #7
0
    def iteritems(self):
        with _IterationGuard(self):
            for wr in self.data.itervalues():
                value = wr()
                if value is not None:
                    yield (wr.key, value)

        return
コード例 #8
0
ファイル: weakref.py プロジェクト: M31MOTH/cpython
 def values(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for wr in self.data.values():
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #9
0
    def iteritems(self):
        with _IterationGuard(self):
            for wr, value in self.data.iteritems():
                key = wr()
                if key is not None:
                    yield (key, value)

        return
コード例 #10
0
ファイル: weakref.py プロジェクト: webiumsk/WOT-0.9.14-CT
    def iteritems(self):
        with _IterationGuard(self):
            for wr, value in self.data.iteritems():
                key = wr()
                if key is not None:
                    yield (key, value)

        return
コード例 #11
0
ファイル: weakref.py プロジェクト: webiumsk/WOT-0.9.14-CT
    def iteritems(self):
        with _IterationGuard(self):
            for wr in self.data.itervalues():
                value = wr()
                if value is not None:
                    yield (wr.key, value)

        return
コード例 #12
0
 def iteritems(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for wr in self.data.itervalues():
             value = wr()
             if value is not None:
                 yield wr.key, value
コード例 #13
0
 def copy(self):
     new = WeakKeyDictionary()
     with _IterationGuard(self):
         for key, value in self.data.items():
             o = key()
             if o is not None:
                 new[o] = value
     return new
コード例 #14
0
ファイル: weakref.py プロジェクト: webiumsk/WOT-0.9.14-CT
    def iterkeys(self):
        with _IterationGuard(self):
            for wr in self.data.iterkeys():
                obj = wr()
                if obj is not None:
                    yield obj

        return
コード例 #15
0
 def itervalues(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for wr in self.data.itervalues():
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #16
0
 def __deepcopy__(self, memo):
     from copy import deepcopy
     new = self.__class__()
     with _IterationGuard(self):
         for key, value in self.data.items():
             o = key()
             if o is not None:
                 new[o] = deepcopy(value, memo)
     return new
コード例 #17
0
 def copy(self):
     if self._pending_removals:
         self._commit_removals()
     new = WeakValueDictionary()
     with _IterationGuard(self):
         for key, wr in self.data.items():
             o = wr()
             if o is not None:
                 new[key] = o
     return new
コード例 #18
0
 def __deepcopy__(self, memo):
     from copy import deepcopy
     if self._pending_removals:
         self._commit_removals()
     new = self.__class__()
     with _IterationGuard(self):
         for key, wr in self.data.items():
             o = wr()
             if o is not None:
                 new[deepcopy(key, memo)] = o
     return new
コード例 #19
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
    def itervaluerefs(self):
        """Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        """
        with _IterationGuard(self):
            yield from self.data.values()
コード例 #20
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
    def itervaluerefs(self):
        """Return an iterator that yields the weak references to the values.

        The references are not guaranteed to be 'live' at the time
        they are used, so the result of calling the references needs
        to be checked before being used.  This can be used to avoid
        creating references that will cause the garbage collector to
        keep the values around longer than needed.

        """
        with _IterationGuard(self):
            yield from self.data.values()
コード例 #21
0
ファイル: weakref.py プロジェクト: 0xcc/pyston
 def itervalues(self):
     with _IterationGuard(self):
         for value in self.data.itervalues():
             yield value
コード例 #22
0
 def iterkeys(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for k in self.data.iterkeys():
             yield k
コード例 #23
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
 def items(self):
     with _IterationGuard(self):
         for k, wr in self.data.items():
             v = wr()
             if v is not None:
                 yield k, v
コード例 #24
0
 async def _do_call(_coro):
     with _IterationGuard(self):
         await _coro
コード例 #25
0
 def keys(self):
     with _IterationGuard(self):
         for (k, wr) in self.data.items():
             while wr() is not None:
                 yield k
コード例 #26
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
 def values(self):
     with _IterationGuard(self):
         for wr, value in self.data.items():
             if wr() is not None:
                 yield value
コード例 #27
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
 def keys(self):
     with _IterationGuard(self):
         for wr in self.data:
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #28
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
 def values(self):
     with _IterationGuard(self):
         for wr in self.data.values():
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #29
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
 def keys(self):
     with _IterationGuard(self):
         for k, wr in self.data.items():
             if wr() is not None:
                 yield k
コード例 #30
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
 def values(self):
     with _IterationGuard(self):
         for wr, value in self.data.items():
             if wr() is not None:
                 yield value
コード例 #31
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
 def keys(self):
     with _IterationGuard(self):
         for wr in self.data:
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #32
0
ファイル: weakref.py プロジェクト: AbuzzT/BR
 def values(self):
     with _IterationGuard(self):
         for wr in self.data.values():
             obj = wr()
             if obj is not None:
                 yield obj
コード例 #33
0
 def iterkeys(self):
     with _IterationGuard(self):
         for k in self.data.iterkeys():
             yield k
コード例 #34
0
 def items(self):
     with _IterationGuard(self):
         for (wr, value) in self.data.items():
             key = wr()
             while key is not None:
                 yield (key, value)
コード例 #35
0
ファイル: weakref.py プロジェクト: 0xcc/pyston
 def iterkeys(self):
     with _IterationGuard(self):
         for k in self.data.iterkeys():
             yield k
コード例 #36
0
 def items(self):
     with _IterationGuard(self):
         for (k, wr) in self.data.items():
             v = wr()
             while v is not None:
                 yield (k, v)
コード例 #37
0
ファイル: weakref.py プロジェクト: dbdoer/godwill
 def items(self):
     with _IterationGuard(self):
         for wr, value in list(self.data.items()):
             key = wr()
             if key is not None:
                 yield key, value
コード例 #38
0
ファイル: weakref.py プロジェクト: kubaszostak/gdal-dragndrop
 def iterkeys(self):
     if self._pending_removals:
         self._commit_removals()
     with _IterationGuard(self):
         for k in self.data.iterkeys():
             yield k
コード例 #39
0
 def itervaluerefs(self):
     with _IterationGuard(self):
         for wr in self.data.itervalues():
             yield wr
コード例 #40
0
 def values(self):
     with _IterationGuard(self):
         for (wr, value) in self.data.items():
             while wr() is not None:
                 yield value
コード例 #41
0
 def iterkeyrefs(self):
     with _IterationGuard(self):
         for wr in self.data.iterkeys():
             yield wr
コード例 #42
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
 def items(self):
     with _IterationGuard(self):
         for k, wr in self.data.items():
             v = wr()
             if v is not None:
                 yield k, v
コード例 #43
0
 def itervalues(self):
     with _IterationGuard(self):
         for value in self.data.itervalues():
             yield value
コード例 #44
0
ファイル: weakref.py プロジェクト: jmbarre2/web_scrape
 def keys(self):
     with _IterationGuard(self):
         for k, wr in self.data.items():
             if wr() is not None:
                 yield k