Giter Site home page Giter Site logo

vrcmarcos / python-deprecated Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 4.0 2.95 MB

Python @deprecated decorator to deprecate old python functions

Home Page: https://pypi.python.org/pypi/Python-Deprecated

License: MIT License

Makefile 7.23% Python 92.77%

python-deprecated's People

Contributors

dschwoerer avatar soxofaan avatar tantale avatar vrcmarcos avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

python-deprecated's Issues

Missing git tag

Your library should be tagged.

Could you, please, add the tag "v1.0.0" ?

TypeError: function() argument 1 must be code, not str

Expected Behavior

Subclass a class that is marked as deprecated shouldn't raises an error.

Actual Behavior

Subclassing a class that's deprecated raises a TypeError

>>> from deprecated import deprecated
>>> @deprecated
... class MyClass: pass
...
>>> class MyOtherClass(MyClass): pass
...
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: function() argument 1 must be code, not str
>>>

Environment

  • Python version: 3.6

https://stackoverflow.com/questions/15155466/decorator-and-error-function-argument-1-must-be-code-not-str

Solution: use a class decorator when applied to a class ?

python-deprecated vs deprecated

Hi, I was exploring available options for a deprecation decorator in Python and found these (among others):

It seems both are pretty much the same.
As far as I understand "Deprecated" started as copy-paste of the code of "Python-Deprecated" in a new git repo (around Nov 2017).

If that is the case: wouldn't it be better to explicitly mark "Python-Deprecated" as deprecated (lol) and forward potential users to "Deprecated", both on github (e.g. in README) and on Pypi?

Release v1.1.0 on PyPi

Hi Marcos,

Could you release the v1.1.0 on PyPi?

First, update your local repository:

git fetch origin master
git reset --hard v1.1.0

Release and push to PyPi

python setup.py release upload

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.