1. 20 Sep, 2019 4 commits
    • Ram Rachum's avatar
      bpo-37937: Mention frame.f_trace in sys.settrace docs (GH-15439) · 9c2682ef
      Ram Rachum authored
      Mention frame.f_trace in sys.settrace docs, as well as the fact you still
      need to call `sys.settrace` to enable the tracing machinery before setting
      `frame.f_trace` will have any effect.
      9c2682ef
    • Prateek Nayak's avatar
    • Lisa Roach's avatar
    • Michael Selik's avatar
      bpo-34002: Minor efficiency and clarity improvements in email package. (GH-7999) · 2702638e
      Michael Selik authored
      * Check intersection of two sets explicitly
      
      Comparing ``len(a) > ``len(a - b)`` is essentially looking for an
      intersection between the two sets. If set ``b`` does not intersect ``a``
      then ``len(a - b)`` will be equal to ``len(a)``. This logic is more
      clearly expressed as ``a & b``.
      
      * Change while/pop to a for-loop
      
      Copying the list, then repeatedly popping the first element was
      unnecessarily slow. I also cleaned up a couple other inefficiencies.
      There's no need to unpack a tuple, then re-pack and append it. The list
      can be created with the first element instead of empty. Secondly, the
      ``endswith`` method returns a bool, so there's no need for an if-
      statement to set ``encoding`` to True or False.
      
      * Use set.intersection to check for intersections
      
      ``a.intersection(b)`` method is more clear of purpose than ``not
      a.isdisjoint(b)`` and avoids an unnecessary set construction that ``a &
      set(b)`` performs.
      
      * Use not isdisjoint instead of intersection
      
      While it reads slightly worse, the isdisjoint method will stop when it
      finds a counterexample and returns a bool, rather than looping over the
      entire iterable and constructing a new set.
      2702638e
  2. 19 Sep, 2019 7 commits
  3. 18 Sep, 2019 5 commits
  4. 17 Sep, 2019 17 commits
  5. 16 Sep, 2019 7 commits