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

docs: add code re-use documentation (WIP) #168

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/language-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ lg-modules
lg-builtins
lg-errors
lg-storage
lg-code-reuse
lg-logs
lg-transactions
lg-ops
Expand Down
27 changes: 27 additions & 0 deletions docs/lg-code-reuse.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Code reuse

## Imports

## Inheritance

TODO: expand upon

Contracts only
* Abstract methods
* super()
* BaseClass.method(self, ...)
* Multiple inheritance
* subroutine, abimethod, baremethod decorators

## Publishing reusable code

TODO: expand upon

Requirements for package to be imported successfully

* Include `py.typed` file
* Include `__init__.py`
* Dependency on `algorand-python`
* Same requirements apply as other Algorand Python code
* Projects created via `algokit init -t python` template are already capable of producing a wheel using poetry `poetry build`
* Ensure passes `puyapy --no-output-teal --no-output-arc32`
2 changes: 2 additions & 0 deletions docs/lg-opcode-budget.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# Opcode budgets

TODO: expand upon this, see https://pyteal.readthedocs.io/en/latest/opup.html

Algorand Python provides a helper method for increasing the [available opcode budget](https://developer.algorand.org/docs/get-details/dapps/avm/teal/#dynamic-operational-cost-of-teal-opcodes), see [`algopy.ensure_budget`](#algopy.ensure_budget).
Loading