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

Pyta = Python + Beta

Inspired by: http://www.cs.utah.edu/plt/publications/oopsla04-gff.pdf

Usage

Inner dispatch is used to guarantee pre- and post-conditions without using auxiliary methods. An external dispatch results in the lowest method that calls inner being called. An inner(cls, self) call calls the next highest method that has an inner call, or the highest method if there is no higher inner method. super works the same as before, but take care not to cause an infinite loop.

Full example:

from pyta import inner, BetaMetaclass

class A(object):
    def foo(self):
        print "world!"

class B(A): # Can inherit from regular classes
    # The lowest class in the hierarchy that uses `inner` needs the metaclass
    __metaclass__ = BetaMetaclass

    def foo(self):
        inner(B, self).foo() # Calls C.foo
        super(B, self).foo() # Calls A.foo

class C(B):
    def foo(self):
        print "Hello, "

obj = C()
obj.foo() # External dispatch; calls B.foo

Caveats

Because using inner in a superclass completely changes which method an external dispatch resolves to (it’s no longer the most-overriding method) the metaclass is required to inspect the source of the methods and sprinkle some magic to make it all work.

In order for everything to work properly, you must call inner(cls, self) lexically. In other words, it won’t work if you do this:

bar = inner
bar(cls, self).foo()

Or this:

from pyta import inner as bar
bar(cls, self).foo()

Currently, the implementation doesn’t distinguish between strings vs. actual method calls, so if your method contains a string like "text inner( moretext", it’ll break everything.

Release History

Release History

0.1.1

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.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
pyta-0.1.1.zip (4.7 kB) Copy SHA256 Checksum SHA256 Source Mar 24, 2013

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