Issue #25590: Make rlcompleter only call getattr() once per attribute

Previously it was called another time via hasattr(), and both calls were
made once for dir(f) and again for dir(f.__class__).  This includes a
backport of changing from a list to a set from revision 4dbb315fe667.
diff --git a/Misc/NEWS b/Misc/NEWS
index e925103..43e0418 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -52,6 +52,9 @@
 Library
 -------
 
+- Issue #25590: In the Readline completer, only call getattr() once per
+  attribute.
+
 - Issue #25530: Disable the vulnerable SSLv3 protocol by default when creating
   ssl.SSLContext.