Giter Club home page Giter Club logo

padme's Introduction

Padme - a mostly transparent proxy class for Python

https://badge.fury.io/py/padme.png https://travis-ci.org/zyga/padme.png?branch=master https://pypip.in/d/padme/badge.png

Features

  • Free software: LGPLv3 license
  • Support for Python 2.7 and Python 3.2+
  • Documentation: https://padme.readthedocs.org.
  • Create proxy classes for any object with :class:`padme.proxy`.
  • Redirect particular methods in subclasses using :class:`padme.unproxied`.

padme's People

Contributors

zyga avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

ujjwalsh

padme's Issues

Unable to proxy types

Perhaps unsurprisingly proxying type-related methods doesn't work.
I think it's possible to get this to work but it may require some new and inventive use of the new method first.

from padme import proxy
class my_int(proxy(int)):
   pass

Transparent and stateful proxies are hard to do

Currently it is somewhat hard to implement a proxy that is both stateful (as it in can have internal state) and transparent (so that the state is invisible on the outside and doesn't clash with the original).

Test fail on python2.7 and mock 1.3

I'll fix this in a moment (I actually already have so I cannot even paste the error) but tests used to fail with more recent version of mock. The _mocks attribute we access is now mock.mock._mocks. I'll fix this in a moment.

Numeric methods are not implemented

To be fully feature complete, it would be nice to implement the host of various numeric dunder methods, such as __add__ and friends. The complete list can be displayed by pydoc3 SPECIALMETHODS

Python 2.7 is not supported

Currently the code is written in pure python 3.x+ but with a few tricks it should be possible to support python 2.7 as well.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.