Refactor and optimize code
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
Start with the code and review discussion linked from pull request #41, since the issue does not identify files or tests. Separate the proposed refactors into an agreed scope, then run the existing project checks and confirm that the affected behavior remains covered after the changes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
@warrior-abhijit has suggested several changes to vcert-python code. We can address them together in one issue.
switch case will be better here ?
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488175192
address todo now ?? as these are lot of if, else in here
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488176457
regex match API would be lot better here and will remove lot of duplicate code below w.r.t regex match
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488177162
switch case may be here as well ?
Originally posted by @warrior-abhijit in https://github.com/Venafi/vcert-python/pull/41#discussion_r488177862
There is a handy Python wrapper called @property. This can be handy here. It would look like this:
@property
def base_url(self):
# This is a getter
return self._base_url
@base_url.setter
def base_url(self, value):
# This is the setter method
self._base_url = self._normalize_and_verify_base_url(value)
It's nicer for refactoring and is pretty explicit.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r492452816
How safe is it in this method to assume that these dictionary keys resolve? I'm new to this code, but I usually think thrice before trying to access a node in the dictionary without .get().
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493173154
Just a tidbit of input: Python string objects have a .startswith() method that's easier to read than a regex, although a regex works fine.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493173571
No use in having a doc string if the parameters aren't described, IMO.
Originally posted by @HELGAHR in https://github.com/Venafi/vcert-python/pull/41#discussion_r493174068
- Ngôn ngữ chính
- Python
- Star
- 22
- Fork
- 23
- Merge trung bình
- 2 ngày 3 giờ
- Pull request đã merge (30 ngày)
- 13
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Venafi/vcert-python
-
RFC: Drop Python 3.9 support Đang mởenhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 28/100
Venafi/vcert-python#208 ·
-
bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
Venafi/vcert-python#133 · 3 bình luận ·
-
enhancement
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
Venafi/vcert-python#114 ·
-
Venafi/vcert-python#91 · 1 người được giao ·
Tất cả issue của Venafi/vcert-python
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
anthropics/skills#1811 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
speaches-ai/speaches#678 ·
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
datalayer/mcp-compose#42 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
conda-forge/spacy-feedstock#177 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
UKGovernmentBEIS/inspect_evals#2523 ·