-
Notifications
You must be signed in to change notification settings - Fork 16
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
sambacc: complete type annotations #47
Changes from 14 commits
17ac18a
c6490c2
f46400a
00f38f4
4241501
596a3a3
e62ff4e
39df468
82df046
2f304f6
aa953d7
3ee1dbe
deb7cae
6aec8fd
1ce43ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -159,19 +159,19 @@ def __repr__(self) -> str: | |
samba_dc = SambaCommand("/usr/sbin/samba") | ||
|
||
|
||
def smbd_foreground(): | ||
def smbd_foreground() -> SambaCommand: | ||
return smbd[ | ||
"--foreground", _daemon_stdout_opt("smbd"), "--no-process-group" | ||
] | ||
Comment on lines
+162
to
165
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. IMHO, now that we have explicit return type, those lines look a bit enigmatic. I would consider (in a separate PR) to have more explicit code (also in other places below):
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll think about it. On the other hand, the square-braces after a SambaCommand object gives you a new SambaCommand object with additional arguments was there from the beginning as a convenient, don't need to repeat yourself, construct. |
||
|
||
|
||
def winbindd_foreground(): | ||
def winbindd_foreground() -> SambaCommand: | ||
return winbindd[ | ||
"--foreground", _daemon_stdout_opt("winbindd"), "--no-process-group" | ||
] | ||
|
||
|
||
def samba_dc_foreground(): | ||
def samba_dc_foreground() -> SambaCommand: | ||
return samba_dc["--foreground"] | ||
|
||
|
||
|
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.
Why no just have a single
wait
function? What is the advantage of usingnext(typing.Iterator[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.
At the time I must have felt implementing the function in terms of an iterator was easier or clearer. This PR only adds the proper type annotation to the function, it doesn't change the runtime behavior. Let's leave that for another time.