<commit_before>---
title: Using the str() Function
excerpt_separator: <!--more-->
author: mickkay
---
This tutorial shows how you could use the <tt>str()</tt> function to get
a glance of the internal structure of an object.
This is especially useful when you don't know how this object is structured.
<!--more-->

For example, let's pretend you are looking at the trunk of a birch tree.

![Looking at a Birch](/images/looking-at-a-birch.png)

When you execute a spell like this:
```lua
/lua print( spell.block))
```
you just get something like the following not very meaningful output:
```lua
table: 0x0626bef0<commit_msg>wording<commit_after>---
title: Using the str() Function
excerpt_separator: <!--more-->
author: mickkay
---
This tutorial shows how you could use the <tt>str()</tt> function to get
a glance of the internal structure of an object.
This is obviously especially useful when you don't know how this object is structured.
<!--more-->

For example, let's pretend you are looking at the trunk of a birch tree.

![Looking at a Birch](/images/looking-at-a-birch.png)

When you execute a spell like this:
```lua
/lua print( spell.block))
```
you just get something like the following not very meaningful output:
```lua
table: 0x0626bef0
{'fraction_non_alphanumeric': 0.11057692307692307, 'fraction_numerical': 0.009615384615384616, 'mean_word_length': 4.2478991596638656, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2333680', 'n_tokens_mistral': 387, 'n_tokens_neox': 358, 'n_words': 176}