Skip to content
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

3972.untyped defs in utils #1259

Open
wants to merge 69 commits into
base: master
Choose a base branch
from

Conversation

danielzwlee
Copy link
Contributor

@danielzwlee danielzwlee commented Feb 16, 2023

Ticket is https://tahoe-lafs.org/trac/tahoe-lafs/ticket/3972,

The scope of this ticket was initially very big and thus I will be focusing on the untyped-defs in the util files first. Since these files seem to be the few most used files and I think type annotations will help greatly in understanding what they do and help catch bugs.

Changes:
Added type annotations to util files.

@coveralls
Copy link
Collaborator

coveralls commented Feb 20, 2023

Coverage Status

Coverage: 94.899% (+0.01%) from 94.885% when pulling 39b5d73 on danielzwlee:3972.untyped-defs into e033f25 on tahoe-lafs:master.

@danielzwlee danielzwlee changed the title 3972.untyped defs 3972.untyped defs in utils Feb 20, 2023
@@ -28,7 +29,7 @@ class AuxValueDict(dict):
values: the main value, and an auxilliary one. Setting the main value
(with the usual d[key]=value) clears the auxvalue. You can set both main
and auxvalue at the same time, and can retrieve the values separately.

s
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo?

@@ -14,15 +14,15 @@
from foolscap import base32


def nodeid_b2a(nodeid):
def nodeid_b2a(nodeid: str) -> str:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would nodeid make a good type?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What library would that be from? I think nodeid should also be bytes right? I understand we want stricter type annotations and I think bytes might be more appropriate, since the function changes bytes to ASCII.

…olscpa.referenceable.RemoteReference to add class variable rref.version which goes against static typing
…olscpa.referenceable.RemoteReference to add class variable rref.version which goes against static typing
@danielzwlee danielzwlee marked this pull request as ready for review March 15, 2023 05:31
@danielzwlee danielzwlee force-pushed the 3972.untyped-defs branch 4 times, most recently from 448fde6 to 3ff30c6 Compare March 16, 2023 05:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants