fixup! Fix for static method too
diff --git a/Source/Modules/python.cxx b/Source/Modules/python.cxx
index 5466afa..7b7e9f9 100644
--- a/Source/Modules/python.cxx
+++ b/Source/Modules/python.cxx
@@ -4830,6 +4830,35 @@
 	int funpack = fastunpack && !Getattr(n, "sym:overloaded");
 	String *pyflags = NewString("METH_STATIC|");
 	int argcount = Getattr(n, "python:argcount") ? atoi(Char(Getattr(n, "python:argcount"))) : 2;
+	if (argcount == 1) {
+	  // Check if the parameter has a default typemap applied.
+	  ParmList *plist = CopyParmList(Getattr(n, "parms"));
+	  Swig_typemap_attach_parms("default", plist, NULL);
+
+	  Parm *p;
+	  Parm *pnext;
+
+	  for (p = plist; p; p = pnext) {
+	    pnext = nextSibling(p);
+	    String *tm = Getattr(p, "tmap:in");
+	    if (tm) {
+	      Parm *in_next = Getattr(p, "tmap:in:next");
+	      if (in_next)
+		pnext = in_next;
+	      if (checkAttribute(p, "tmap:in:numinputs", "0")) {
+		continue;
+	      }
+	    }
+
+	    if (Getattr(p, "tmap:default")) {
+	      // Set argcount to 2 to trigger use of METH_VARARGS below.
+	      argcount = 2;
+	    }
+	    break;
+	  }
+	  Delete(plist);
+	}
+
 	if (funpack && argcount == 0)
 	  Append(pyflags, "METH_NOARGS");
 	else if (funpack && argcount == 1)