Hacktoberfest PR: Cleaning Up Code

Issue
PR

hiero-sdk-python is a Python SDK for the Hiero blockchain — a toolkit that helps developers interact with smart contracts, tokens, and transactions through Python.
It’s structured a lot like the Hedera SDK, where each type of blockchain trans…


This content originally appeared on DEV Community and was authored by Aubrey D

Issue
PR

hiero-sdk-python is a Python SDK for the Hiero blockchain — a toolkit that helps developers interact with smart contracts, tokens, and transactions through Python.
It’s structured a lot like the Hedera SDK, where each type of blockchain transaction (freeze, unfreeze, transfer, etc.) has its own class, all inheriting from a shared base class called Transaction.

This SDK has a clear focus on clean design and maintainability, which is why this issue existed in the first place. The issue described a small but important cleanup: the TokenUnfreezeTransaction class had some duplicate logic that was already implemented in its parent class. The goal was to remove the extra field and method, and update the internal calls to use the inherited _require_not_frozen() instead.

This one was pretty straightforward, but it needed careful attention to detail.

Here’s what I did:
1. Removed the line that declared _is_frozen in token_unfreeze_transaction.py.
2. Deleted the __require_not_frozen() method entirely.
3. Replaced all instances of self.__require_not_frozen() with self._require_not_frozen() to make sure the class now used the inherited version from Transaction.

Before this PR, I didn’t realize how important method naming conventions could be in large codebases. In Python, a double underscore method gets “name-mangled”, so it doesn’t behave exactly the same as a protected _method. That subtle difference can lead to bugs if you don’t notice it.


This content originally appeared on DEV Community and was authored by Aubrey D


Print Share Comment Cite Upload Translate Updates
APA

Aubrey D | Sciencx (2025-10-31T08:48:44+00:00) Hacktoberfest PR: Cleaning Up Code. Retrieved from https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/

MLA
" » Hacktoberfest PR: Cleaning Up Code." Aubrey D | Sciencx - Friday October 31, 2025, https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/
HARVARD
Aubrey D | Sciencx Friday October 31, 2025 » Hacktoberfest PR: Cleaning Up Code., viewed ,<https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/>
VANCOUVER
Aubrey D | Sciencx - » Hacktoberfest PR: Cleaning Up Code. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/
CHICAGO
" » Hacktoberfest PR: Cleaning Up Code." Aubrey D | Sciencx - Accessed . https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/
IEEE
" » Hacktoberfest PR: Cleaning Up Code." Aubrey D | Sciencx [Online]. Available: https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/. [Accessed: ]
rf:citation
» Hacktoberfest PR: Cleaning Up Code | Aubrey D | Sciencx | https://www.scien.cx/2025/10/31/hacktoberfest-pr-cleaning-up-code/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.