class_docstr: A list of prime numbers, implemented as a dynamically
  growing sieve of Eratosthenes. When a lookup is requested involving
  an odd number that has not been sieved, the sieve is automatically
  extended up to that number. Implementation details limit the number of
  primes to ``2^32-1``.
  
  Examples
  ========
  
  >>> from sympy import sieve
  >>> sieve._reset() # this line for doctest only
  >>> 25 in sieve
  False
  >>> sieve._list
  array('L', [2, 3, 5, 7, 11, 13, 17, 19, 23])
class_docstr_tok: ["A","list","of","prime","numbers",",","implemented","as","a","dynamically","growing","sieve","of","Eratosthenes",".","When","a","lookup","is","requested","involving","an","odd","number","that","has","not","been","sieved",",","the","sieve","is","automatically","extended","up","to","that","number",".","Implementation","details","limit","the","number","of","primes","to","``","2^32-1","``",".","Examples","========",">",">",">","from","sympy","import","sieve",">",">",">","sieve._reset","(",")","#","this","line","for","doctest","only",">",">",">","25","in","sieve","False",">",">",">","sieve._list","array","(","'","L","'",",","[","2",",","3",",","5",",","7",",","11",",","13",",","17",",","19",",","23","]",")"]
docstr: Generate all prime numbers in the range [2, a) or [a, b).
  
  Examples
  ========
  
  >>> from sympy import sieve, prime
  
  All primes less than 19:
  
  >>> print([i for i in sieve.primerange(19)])
  [2, 3, 5, 7, 11, 13, 17]
  
  All primes greater than or equal to 7 and less than 19:
  
  >>> print([i for i in sieve.primerange(7, 19)])
  [7, 11, 13, 17]
  
  All primes through the 10th prime
  
  >>> list(sieve.primerange(prime(10) + 1))
  [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
docstr_tok: ["Generate","all","prime","numbers","in","the","range","[","2",",","a",")","or","[","a",",","b",")",".","Examples","========",">",">",">","from","sympy","import","sieve",",","prime","All","primes","less","than","19",":",">",">",">","print","(","[","i","for","i","in","sieve.primerange","(","19",")","]",")","[","2",",","3",",","5",",","7",",","11",",","13",",","17","]","All","primes","greater","than","or","equal","to","7","and","less","than","19",":",">",">",">","print","(","[","i","for","i","in","sieve.primerange","(","7",",","19",")","]",")","[","7",",","11",",","13",",","17","]","All","primes","through","the","10th","prime",">",">",">","list","(","sieve.primerange","(","prime","(","10",")","+","1",")",")","[","2",",","3",",","5",",","7",",","11",",","13",",","17",",","19",",","23",",","29","]"]
code: def primerange(self, a, b=None):
      """Generate all prime numbers in the range [2, a) or [a, b).
  
      Examples
      ========
  
      >>> from sympy import sieve, prime
  
      All primes less than 19:
  
      >>> print([i for i in sieve.primerange(19)])
      [2, 3, 5, 7, 11, 13, 17]
  
      All primes greater than or equal to 7 and less than 19:
  
      >>> print([i for i in sieve.primerange(7, 19)])
      [7, 11, 13, 17]
  
      All primes through the 10th prime
  
      >>> list(sieve.primerange(prime(10) + 1))
      [2, 3, 5, 7, 11, 13, 17, 19, 23, 29]
  
      """
      if b is None:
          b = _as_int_ceiling(a)
          a = 2
      else:
          a = max(2, _as_int_ceiling(a))
          b = _as_int_ceiling(b)
      if a >= b:
          return
      self.extend(b)
      yield from self._list[
          bisect_left(self._list, a) : bisect_left(self._list, b)
      ]
  
imports: from bisect import bisect, bisect_left
  from itertools import count
  from array import array
  from sympy.core.function import Function
  from sympy.core.random import randint
  from sympy.core.singleton import S
  from sympy.external.gmpy import sqrt
  from .primetest import isprime
  from sympy.utilities.misc import as_int
label_desc: Use image node_id 7 for calling the Sieve obj's underlying member method code with example usage: obj.primerange(a, b) without return types