Check if arg was passed with keyword

8 views
Skip to first unread message

jbrock...@gmail.com

unread,
Jan 10, 2022, 10:27:07 PM1/10/22
to cython-users
pd.Timestamp.__new__ takes a bunch of arguments and I'd like to make some of them keyword-only.  Doing that will require a deprecation cycle.  To implement that I need to be able to check at runtime whether the user did e.g. pd.Timestamp(x, y, z) vs pd.Timestamp(x, y, tz=z).  Is there a way to do this in cython?

da-woods

unread,
Jan 11, 2022, 5:46:10 AM1/11/22
to cython...@googlegroups.com
Since that pd.Timestamp looks to be a non-cdef class, I'd think the decorator should work (and would at least be worth a bug report if it doesn't).

I don't think there's any specific Cython mechanism to this though - anything you do would be using the normal Python mechanisms.


On 11/01/2022 03:27, jbrock...@gmail.com wrote:
pd.Timestamp.__new__ takes a bunch of arguments and I'd like to make some of them keyword-only.  Doing that will require a deprecation cycle.  To implement that I need to be able to check at runtime whether the user did e.g. pd.Timestamp(x, y, z) vs pd.Timestamp(x, y, tz=z).  Is there a way to do this in cython?

--

---
You received this message because you are subscribed to the Google Groups "cython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cython-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cython-users/b734d897-9e7e-42db-bf17-133d05369f44n%40googlegroups.com.


Reply all
Reply to author
Forward
0 new messages