This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description
Overview
========

Functional style 'list' and 'dict' classes & decorators for pattern matching function dispatch.

For more information, visit http://www.systemical.com/doc/opensource/pyfnc


Examples
========

Dictionary class 'dic' with 'return self' functionality:

>>> d=dic({"k2":"v2"})
>>> dr=d.update({"k1":"v1"})
>>> self.assertEqual(d, dr)

List class 'liste' with 'return self' functionality and integrated 'map', 'reduce' and 'filter' functions:

>>> l=liste()
>>> lr=l.extend([1,2,3])
>>> self.assertEqual(len(l), 3)
>>> self.assertEqual(l, lr)

>>> f=lambda x:x+10

>>> lm=l.map(f)
>>> self.assertEqual(lm, [11, 12, 13])
>>> self.assertEqual(l, [11, 12, 13])


Erlang style function dispatch:

>>> @pattern('male', str)
... def greet_male(p1, p2):
... return "Hello M. %s!" % p2

>>> @pattern('female', str)
... def greet_female(p1, p2):
... return "Hello Mrs. %s!" % p2

>>> @patterned
... def greet(p1, p2):
... pass

>>> print greet("male", "Dupont")
"Hello M. Dupont!"

>>> print greet("female", "Corriveau")
"Hello Mrs. Corriveau!"


Clean looking reducers:


@pattern(False, any)
def comp_reducer_FA(p1, p2):
return False

@pattern(str, str)
def comp_reducer_SS(p1, p2):
if p1==p2:
return p1
return False

@patterned
def comp_reducer(p1, p2):
'''
Reducer

Check if all strings are equal
'''


def strings_comparator(l):
'''
Returns the common string if all elements of 'l' are equal
else returns False
'''
if len(l)<2:
return False

return reduce(comp_reducer, l)


Tests
=====

Tests can be performed using `nosetests` in the root directory.
Release History

Release History

0.1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

0.1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
pyfnc-0.1.2.tar.gz (7.1 kB) Copy SHA256 Checksum SHA256 Source Feb 8, 2012
pyfnc-0.1.2.zip (13.6 kB) Copy SHA256 Checksum SHA256 Source Feb 8, 2012

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting