ANN: Anonfunc 1.0 (original) (raw)

Hye-Shik Chang perky@i18n.org
Sun, 4 Jan 2004 11:58:40 +0900


--huq684BweRXVnRxX Content-Type: text/plain; charset=us-ascii Content-Disposition: inline

Hello!

Anonfunc module is a C extension module provides very simple proxy object that creates anonymous functions based on they got operated. See the demo:

(X, Y, Z is provided to builtins from anonfunc automatically.)

f = X + Y * Z f(1, 2, 3) 7

f = divmod(X ** 3 + X ** 2, 5) f(12) (374, 2)

f = X[:5] + Y[-5:] f(range(10), range(20)) [0, 1, 2, 3, 4, 15, 16, 17, 18, 19]

f1 = X ** 3 + 3 * (X ** 2) f2 = X + Y % X (f1 * f2)(3, 4) 216

import sys f = anonfunc('mod').platform f(mod=sys) 'freebsd5'

But you can't use it with complete set of python operators because anonfunc implementation is just based on operator overloadings. Use it after you know what really it is. :)

You can download it from http://www.freebsd.org/cgi/pds.cgi?ports/devel/py-anonfunc

Thank you!

Regards, Hye-Shik

--huq684BweRXVnRxX Content-Type: application/pgp-signature Content-Disposition: inline

-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD)

iD8DBQE/94FfDWUsWc/bS6QRAvHOAJsGVvdhf8oTmm7hMkz7P779QLZxrQCeM+qA /j1KEFszNCYYyPb6W+9sG8Y= =p0PF -----END PGP SIGNATURE-----

--huq684BweRXVnRxX--