-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Refactor] Clean up helper functions in tools.util #4174
Conversation
✔️ Deploy Preview for docsite-preview canceled. 🔨 Explore the source changes: 237ccb0 🔍 Inspect the deploy log: https://app.netlify.com/sites/docsite-preview/deploys/61f3685d4751940007d3dc99 |
/format |
python/taichi/lang/util.py
Outdated
""" | ||
def wrapped(*args, **kwargs): | ||
msg = f'{old} is obsolete. Please use {new} instead.' | ||
raise SyntaxError(msg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TaichiSyntaxError?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
python/taichi/lang/util.py
Outdated
print(Style.RESET_ALL, end='') | ||
|
||
|
||
def deprecated(old, new, warning_type=DeprecationWarning): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we still use this function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No... We can remove this.
python/taichi/lang/util.py
Outdated
return decorator | ||
|
||
|
||
def obsolete(old, new): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we do this in __getattr__
as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes but actually I think this can be removed. We don't need so many levels for deprecating things for now and this is only used in one place one year ago.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Related issue = #3782
This PR serves as the second step towards putting functions under tools.util (see #4172) in correct places.