-
Notifications
You must be signed in to change notification settings - Fork 35
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
API ideas/suggestions #31
Comments
I can't say I like the name
In general I think this may be a good idea. What is your (more detailed) plan for this? |
About |
@ilevkivskyi I'm not too sure what better name to use. My, rather simple, plan is:
Also:
Would you want these too? |
Sorry for long silence, I went vacation for couple weeks and then it took time to be back on track.
I want to keep all current functions so that we maintain full backwards compatibility with previous versions of
It is wanted, but not very important.
Yes, this is wanted and important (except in some cases where it reflects some crucial changes in |
I'll only include new functions publicly, these functions require the duplicate functions to work and so I'll hide them in a sub package, I should be able to start looking into the PR next week. |
I would rather chose a name like |
@ilevkivskyi Unfortunately this is taking longer than expected. I've been focusing on improving typing_inspect_lib's code quality, currently through linters and coverage.py, which is at ~97%. Only the documentation seems to be lacking significantly now. I'm unsure what your docstrings conform to, and can't find anything in your configuration files to test against. I'm planning on using pydocstyle and vanilla Sphinx to help ensure that they at least somewhat resemble yours. Is this the correct environment? |
I don't have any docstring style enforcement. I just try to follow some basic guidelines in PEP 257. But if you want you can try adding a linter for this. |
One function I needed and implemented is
If I do:
I can call The issue is only that I want to call it inside |
I'm not sure if this is appropriate but:
Would it be better to add a layer of abstraction over
__origin__
and__extra__
and have a function, sayget_typing
, return both? (get_typing(Mapping) == (Mapping, collections.abc.Mapping)
)Why I thought it would:
In Python 3.7
__origin__
is a different type and so makes users have to use the following to get the same type. (This has been raised here as well What is get_origin(typing.Dict) meant to return? #27)It doesn't seem like 3.7 has an
__extra__
or any easy way to gettyping.X
fromtyping.X[T]
. And so there's no easy way to get the 'typing type', without the library explicitly allowing that.In my library I only have
get_typing
rather thanget_origin
andget_last_origin
.Am I being short sighted by thinking you don't need
get_origin
in Py3.6?Likewise with
get_last_args
.I've implemented
get_bases
,get_parents
,get_mro
andget_mro_orig
which would fix #6. But unfortunately uses the other functions that may not work exactly the same way yours do. And also uses some code you may not like (links.py and _conv).Would you be interested in merging our efforts?
The text was updated successfully, but these errors were encountered: