ocket8888 commented on a change in pull request #5506:
URL: https://github.com/apache/trafficcontrol/pull/5506#discussion_r574124600



##########
File path: .github/actions/pr-to-update-go/pr_to_update_go/GoPRMaker.py
##########
@@ -0,0 +1,210 @@
+#!/usr/bin/env python3
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+import json
+import os
+import re
+import requests
+import sys
+
+from github.InputGitAuthor import InputGitAuthor
+from github.Label import Label
+from requests import Response
+
+from github.Branch import Branch
+from github.GithubException import BadCredentialsException, GithubException, 
UnknownObjectException
+from github.MainClass import Github
+from github.Milestone import Milestone
+from github.PaginatedList import PaginatedList
+from github.PullRequest import PullRequest
+from github.Repository import Repository
+
+from pr_to_update_go.constants import ENV_GITHUB_TOKEN, GO_VERSION_URL, 
ENV_GITHUB_REPOSITORY, \
+    ENV_GITHUB_REPOSITORY_OWNER, GO_REPO_NAME, RELEASE_PAGE_URL, 
ENV_GO_VERSION_FILE, ENV_GIT_AUTHOR_NAME, \
+    GIT_AUTHOR_EMAIL_TEMPLATE
+
+
+class GoPRMaker:
+    gh: Github
+    latest_go_version: str
+    repo: Repository
+
+    def __init__(self, gh: Github) -> None:
+        self.gh = gh
+        repo_name: str = self.get_repo_name()
+        self.repo = self.get_repo(repo_name)
+
+    def run(self) -> None:

Review comment:
       So Pycharm treats implicit return types as 
[Any](https://docs.python.org/3/library/typing.html#typing.Any) ? As a 
Typescript programmer I turn my nose up at such sloppy inference!
   
   But that's fine.
   
   It's weird to me that `typing` has an `any` and a `never` but not a `void`. 
Ideally you'd be able to do
   ```python3
   from typing import Any, Void
   
   def a() -> Void:
       pass
   
   b: Any = a()
   ```
   
   and that would show up in linters/IDEs/whathaveyou as an invalid assignment 
of void to a value. But I guess the technology just isn't there yet.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to