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
base: master
Are you sure you want to change the base?
Conversation
…fault None but cannot assign Optional[int]
d7bed1a
to
96ec232
Compare
src/allmydata/util/dictutil.py
Outdated
@@ -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 |
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.
Typo?
src/allmydata/util/idlib.py
Outdated
@@ -14,15 +14,15 @@ | |||
from foolscap import base32 | |||
|
|||
|
|||
def nodeid_b2a(nodeid): | |||
def nodeid_b2a(nodeid: str) -> 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.
Would nodeid make a good type?
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.
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
a362403
to
3b8ba8b
Compare
574e605
to
ef4e347
Compare
d348440
to
29cefe6
Compare
e6acbaf
to
e0362dc
Compare
448fde6
to
3ff30c6
Compare
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.