Index: python26/Portfile
===================================================================
--- python26/Portfile	(revision 140412)
+++ python26/Portfile	(working copy)
@@ -151,6 +151,14 @@
    }
 }
 
+default_variants     +readline
+
+variant readline description {Use readline instead of libedit} {
+    patchfiles-delete       patch-libedit.diff
+    depends_lib-append      port:readline
+    depends_lib-delete      port:libedit
+}
+
 variant universal {
    post-patch {
       set universal_arch_flags {}
Index: python27/Portfile
===================================================================
--- python27/Portfile	(revision 140412)
+++ python27/Portfile	(working copy)
@@ -133,6 +133,14 @@
     }
 }
 
+default_variants     +readline
+
+variant readline description {Use readline instead of libedit} {
+    patchfiles-delete       patch-libedit.diff
+    depends_lib-append      port:readline
+    depends_lib-delete      port:libedit
+}
+
 variant universal {
     # This patch will need updating when 2.7.6 is released, as ARCH_RUN_32BIT
     # will once again be used for something. See ticket #39270.
Index: python34/Portfile
===================================================================
--- python34/Portfile	(revision 140412)
+++ python34/Portfile	(working copy)
@@ -139,6 +139,14 @@
    }
 }
 
+default_variants     +readline
+
+variant readline description {Use readline instead of libedit} {
+    patchfiles-delete       patch-libedit.diff
+    depends_lib-append      port:readline
+    depends_lib-delete      port:libedit
+}
+
 variant universal {
    post-patch {
       set universal_arch_flags {}
Index: python35/Portfile
===================================================================
--- python35/Portfile	(revision 140412)
+++ python35/Portfile	(working copy)
@@ -139,6 +139,14 @@
    }
 }
 
+default_variants     +readline
+
+variant readline description {Use readline instead of libedit} {
+    patchfiles-delete       patch-libedit.diff
+    depends_lib-append      port:readline
+    depends_lib-delete      port:libedit
+}
+
 variant universal {
     post-patch {
         set universal_arch_flags {}
