[Python-Dev] Python's footprint

Gustavo Niemeyer niemeyer@conectiva.com
Wed, 14 Nov 2001 20:07:03 -0200


--TYecfFk8j8mZq+dy
Content-Type: multipart/mixed; boundary="b5gNqxB1S1yM7hjW"
Content-Disposition: inline


--b5gNqxB1S1yM7hjW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

> > It means that about 10% of python's executable is documentation.
[...]
> Anyways, that sounds like a useful idea.  It would probably be a big
> patch that touches lots of files, so it's unlikely to get into Python
> 2.2.  You might consider whipping up a patch now to get it under
> consideration early in 2.3's life-cycle.

Ok. The patch is ready (attached). It's very simple. Just introducing
two new macros: Py_DOCSTR() to be used in usual doc strings, and
WITH_DOC_STRINGS, for more complex ones (sys module's doc string
comes into my mind).

I'd just like to know the moment when it is going to be applied, so I
can change every documentation string accordingly and submit the patch.
I could do this right now, for sure. But if it's going to be applied
just for 2.3, the patch will certainly be broken at that time.

Thanks!

--=20
Gustavo Niemeyer

[ 2AAC 7928 0FBF 0299 5EB5  60E2 2253 B29A 6664 3A0C ]

--b5gNqxB1S1yM7hjW
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="Python-2.2-docstr.patch"
Content-Transfer-Encoding: quoted-printable

--- Python-2.2.orig/pyconfig.h.in	Wed Nov 14 17:54:31 2001
+++ Python-2.2/pyconfig.h.in	Wed Nov 14 19:08:08 2001
@@ -765,3 +765,13 @@
 #define STRICT_SYSV_CURSES /* Don't use ncurses extensions */
 #endif
=20
+/* Define if you want to have inline documentation. */
+#undef WITH_DOC_STRINGS
+
+/* Define macro for inline documentation. */
+#ifdef WITH_DOC_STRINGS
+#define Py_DOCSTR(x) x
+#else
+#define Py_DOCSTR(x) ""
+#endif
+
--- Python-2.2.orig/configure.in	Wed Nov 14 17:54:31 2001
+++ Python-2.2/configure.in	Wed Nov 14 19:20:07 2001
@@ -1305,6 +1305,20 @@
 fi
 AC_MSG_RESULT($with_cycle_gc)
=20
+# Check for --with-doc-strings
+AC_MSG_CHECKING(for --with-doc-strings)
+AC_ARG_WITH(doc-strings,
+[  --with(out)-doc-strings         disable/enable documentation strings])
+
+if test -z "$with_doc_strings"
+then with_doc_strings=3D"yes"
+fi
+if test "$with_doc_strings" !=3D "no"
+then
+    AC_DEFINE(WITH_DOC_STRINGS)
+fi
+AC_MSG_RESULT($with_doc_strings)
+
 # Check for Python-specific malloc support
 AC_MSG_CHECKING(for --with-pymalloc)
 AC_ARG_WITH(pymalloc,

--b5gNqxB1S1yM7hjW--

--TYecfFk8j8mZq+dy
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE78usHIlOymmZkOgwRAl1NAKCO0TFTRa/tiPcfkltlQvJk8kBrxACg03d0
Y1e6KuoSN3zH+kinMKxUjsE=
=9pvB
-----END PGP SIGNATURE-----

--TYecfFk8j8mZq+dy--