{ "info": { "author": "Alan Franzoni", "author_email": "username@franzoni.eu", "bugtrack_url": null, "classifiers": [], "description": ".. -*- restructuredtext -*-\n\n=========\nducktypes\n=========\nDuck typing support library\n---------------------------\n\nRationale\n=========\n\nAllows working with objects depending on their current behaviour, not their type or their registered (ABC-like) interface.\n\nQuick example::\n\n from ducktypes.ducktype import Duck\n\n class MyObject(object):\n def some_method(self, a, b):\n pass\n def another_method(self, x):\n pass\n\n\n class AnotherObject(object):\n def some_method(self, a, b):\n pass\n def another_method(self, a):\n pass\n\n class AnotherDifferentObject(object):\n def some_method(self, a, b, c):\n pass\n def another_method(self, a):\n pass\n\n duck = Duck(MyObject())\n\n print \"AnotherObject instances implement MyObject interface: \", duck.maybe_implemented_by(AnotherObject())\n print \"AnotherDifferentObject instances implement MyObject interface:\", duck.maybe_implemented_by(AnotherDifferentObject())\n\nOutput::\n \n AnotherObject instances implement MyObject interface: True\n AnotherDifferentObject instances implement MyObject interface: False\n\n\nGotchas\n=======\n\n * positional arguments are supposed to be called as positional arguments, and keyword arguments are supposed to be called as positional arguments. If your client code calls keyword arguments as positional ones, signature matching may fail.\n * proxy-everything methods, i.e. ``(*args, **kwargs)``-like signature, will of course deceive our signature detection system.\n\n\nTodo\n====\n * __getattr__ / __getattribute__ overriding functions\n * subclasses exposing special methods with different signature\n * C-declared functions that don't expose their signature.\n * implement optional strict checking.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://ducktypes.franzoni.eu", "keywords": "duck typing interfaces", "license": "APL 2.0", "maintainer": null, "maintainer_email": null, "name": "ducktypes", "package_url": "https://pypi.org/project/ducktypes/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ducktypes/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://ducktypes.franzoni.eu" }, "release_url": "https://pypi.org/project/ducktypes/0.2.5/", "requires_dist": null, "requires_python": null, "summary": "behaviour based duck typing library", "version": "0.2.5" }, "last_serial": 791430, "releases": { "0.2.1": [], "0.2.2": [], "0.2.3": [ { "comment_text": "", "digests": { "md5": "1479f3e62f89ce7a088a499f40b98952", "sha256": "6d2b6013d13bea7bccbfbf0d63bec5f66d59308cb7e0bda3fe2defa04d650993" }, "downloads": -1, "filename": "ducktypes-0.2.3.tar.gz", "has_sig": false, "md5_digest": "1479f3e62f89ce7a088a499f40b98952", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7621, "upload_time": "2011-05-21T11:23:07", "url": "https://files.pythonhosted.org/packages/80/eb/f43d44349c049f556199d37427549ba7124d25cae58107484fbd612a5e88/ducktypes-0.2.3.tar.gz" } ], "0.2.4": [ { "comment_text": "", "digests": { "md5": "b6bb29040b40861c9f5a5abd4e7f7644", "sha256": "d59650bfbbbd0c518076cff1bc700a86595a5e57e242a63be5221fd3a8365b07" }, "downloads": -1, "filename": "ducktypes-0.2.4.tar.gz", "has_sig": false, "md5_digest": "b6bb29040b40861c9f5a5abd4e7f7644", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7784, "upload_time": "2011-05-24T00:10:20", "url": "https://files.pythonhosted.org/packages/80/6e/cb6228485a4ceb118738395a472f118c2b4b49a9e89b97f6330d56f71b43/ducktypes-0.2.4.tar.gz" } ], "0.2.5": [ { "comment_text": "", "digests": { "md5": "202a9f40b231d019b3ea6d66b5e80f49", "sha256": "a07ea1849da4328c4e18c2f4bf6c89334dd1eb0d563963d057522da675a9a33b" }, "downloads": -1, "filename": "ducktypes-0.2.5.zip", "has_sig": false, "md5_digest": "202a9f40b231d019b3ea6d66b5e80f49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16357, "upload_time": "2013-01-24T17:39:34", "url": "https://files.pythonhosted.org/packages/ae/35/67a8271be75e0171376cc674ead3b08953292fb7f8f6df21259c201ae415/ducktypes-0.2.5.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "202a9f40b231d019b3ea6d66b5e80f49", "sha256": "a07ea1849da4328c4e18c2f4bf6c89334dd1eb0d563963d057522da675a9a33b" }, "downloads": -1, "filename": "ducktypes-0.2.5.zip", "has_sig": false, "md5_digest": "202a9f40b231d019b3ea6d66b5e80f49", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16357, "upload_time": "2013-01-24T17:39:34", "url": "https://files.pythonhosted.org/packages/ae/35/67a8271be75e0171376cc674ead3b08953292fb7f8f6df21259c201ae415/ducktypes-0.2.5.zip" } ] }