> For the complete documentation index, see [llms.txt](https://sandbox-docs.verifone.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/namespaces/namespacepackmanlib/namespacepackmanlib_1_1treewalk/classpackmanlib_1_1treewalk_1_1_tree_walker.md).

# TreeWalker

[Public Member Functions](#pub-methods) | [Static Public Member Functions](#pub-static-methods) | [Data Fields](#pub-attribs)

|                         |                                                                                                                                                                                                                                                                             |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Public Member Functions |                                                                                                                                                                                                                                                                             |
| def                     | [\_\_init\_\_](#a8959b99ed170ca2ff5746a9f132b3fec) (self, [max\_arc\_depth](#a6477cbfdaff96a77de0cfe7edc1ddb11), [max\_depth](#abe0b4340c0a3ede312856c001b86d7ed), [writable\_only](#af47dbfb6056d76098bd84472beab442f), [post\_order](#a81bec6e1a4754daae86bdef84ac8fa14)) |

|                                |                                                                                                                                                                                                                                                                                                                                                                |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Static Public Member Functions |                                                                                                                                                                                                                                                                                                                                                                |
| def                            | [walk](#ac3ce320a4b61165e04d04473720d017c) (nodes, [observers](#a6b0642912968743133a34ab9d32e2285), [max\_arc\_depth](#a6477cbfdaff96a77de0cfe7edc1ddb11)=-1, [max\_depth](#abe0b4340c0a3ede312856c001b86d7ed)=-1, children\_start=False, [writable\_only](#af47dbfb6056d76098bd84472beab442f)=False, [post\_order](#a81bec6e1a4754daae86bdef84ac8fa14)=False) |
|                                | <p>Performs a depth-first / pre-order walk through the node calling observers callbacks. <a href="#ac3ce320a4b61165e04d04473720d017c">More...</a><br></p>                                                                                                                                                                                                      |

|             |                                                       |
| ----------- | ----------------------------------------------------- |
| Data Fields |                                                       |
|             | [observers](#a6b0642912968743133a34ab9d32e2285)       |
|             | [max\_arc\_depth](#a6477cbfdaff96a77de0cfe7edc1ddb11) |
|             | [max\_depth](#abe0b4340c0a3ede312856c001b86d7ed)      |
|             | [writable\_only](#af47dbfb6056d76098bd84472beab442f)  |
|             | [post\_order](#a81bec6e1a4754daae86bdef84ac8fa14)     |

### Constructor& Destructor Documentation

### \_\_init\_\_() <a href="#a8959b99ed170ca2ff5746a9f132b3fec" id="a8959b99ed170ca2ff5746a9f132b3fec"></a>

def \\\_\\\_init\\\_\\\_

### MemberFunction Documentation <a href="#member-function-documentation" id="member-function-documentation"></a>

### walk() <a href="#ac3ce320a4b61165e04d04473720d017c" id="ac3ce320a4b61165e04d04473720d017c"></a>

def walk

static

Performs a depth-first / pre-order walk through the node calling observers callbacks.

**Parameters**

**node** start traversal from these nodes (single or list) **observers** list of observers to be called **max\_arc\_depth** maximum archive recursion depth, negative is infinite **max\_depth** maximum recursion depth, negative is infinite **children\_start** start with node's children instead of node itself **writable\_only** call observers only on writable nodes **post\_order** post-order traversal if True, pre-order traversal if False

### FieldDocumentation <a href="#field-documentation" id="field-documentation"></a>

### max\_arc\_depth <a href="#a6477cbfdaff96a77de0cfe7edc1ddb11" id="a6477cbfdaff96a77de0cfe7edc1ddb11"></a>

max\_arc\_depth

### max\_depth <a href="#abe0b4340c0a3ede312856c001b86d7ed" id="abe0b4340c0a3ede312856c001b86d7ed"></a>

max\_depth

### observers <a href="#a6b0642912968743133a34ab9d32e2285" id="a6b0642912968743133a34ab9d32e2285"></a>

observers

### post\_order <a href="#a81bec6e1a4754daae86bdef84ac8fa14" id="a81bec6e1a4754daae86bdef84ac8fa14"></a>

post\_order

### writable\_only <a href="#af47dbfb6056d76098bd84472beab442f" id="af47dbfb6056d76098bd84472beab442f"></a>

writable\_only

***

The documentation for this class was generated from the following file:

* packman/packmanlib/[treewalk.py](/s-adk-5.1-programmers-guide/readme/files/dir_026ced32df3e5de142ca5346a10962b0/dir_76d7bc695de4919fb54ecb5d68e5f54d/treewalk_8py.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://sandbox-docs.verifone.com/s-adk-5.1-programmers-guide/readme/namespaces/namespacepackmanlib/namespacepackmanlib_1_1treewalk/classpackmanlib_1_1treewalk_1_1_tree_walker.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
