-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
dateutil first version #133
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
Conversation
PERTAIN = ... # type: List[str] | ||
TZOFFSET = ... # type: Dict[str, int] | ||
|
||
def __init__(self, dayfirst: bool=..., yearfirst: bool=...) -> None: |
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.
Style suggestion: in stubs we prefer compactness and it's fine to put the "..." of the method body on the same line and omit the blank lines between methods.
Hey, sorry for the slow response. I just realized I've never used dateutil so I don't really have any idea whether this stub is adequate or not. Also, because it's third party, could you ask the dateutil author whether they are okay with having a dateutil stub in typeshed? See the note in README.md under "third_party". |
The original author of dateutil does not currently maintain the library, but I'm one of the two principal maintainers (and since the other guy has a newborn, probably the one most likely to respond to you) and I'm fine with a stub being included. |
|
||
def parse( | ||
self, | ||
timestr: str, |
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.
I'm not overly familiar with how type annotations work, but you may want to be aware that timestr
duck-types the input. In Python 3.x will take bytes
, str
or stream objects that implement read()
. The preferred input is probably str
, though.
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.
Maybe a union of bytes, str and IO would work.
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
@jukebox: I don't understand what happened, but it looks like a whole bunch of merged commits ended up in your PR. Could you clean that up (maybe try a rebase) or start a new PR? The comment from #133 (comment) indicates we can go ahead with this PR, but it's currently impossible to review due to the merge noise. |
is it ok now ? |
Yup, thanks! Does dateutil support Python 2 also? |
|
@jukebox Are you going to continue filling out the rest of the stub? If not, I am probably in a pretty good position to flesh out most of the library. I'll just need a bit of time to familiarize myself with the exact notation and whatnot. It seems that these stubs also cover the private interface, which makes sense, but makes things a bit more complicated, I would think, especially given #153. |
@pganssle i think i dont have time to continue the stub and i dont use other methods and old python versions. |
OK, I'll make a separate PR covering 2.x and expanding coverage to the whole library. |
No description provided.