Skip to content

Commit

Permalink
Commentary on Flattenables
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanjjung committed Jan 14, 2025
1 parent 578b512 commit 8a9f5aa
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tb_pulumi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from typing import Any


#: Type alias representing valid types to be found among a ThunderbirdPulumiProject's resources
type Flattenable = dict | list | ThunderbirdComponentResource | pulumi.Output | pulumi.Resource

class ThunderbirdPulumiProject:
Expand Down Expand Up @@ -232,8 +233,8 @@ def flatten(item: Flattenable) -> set[pulumi.Resource]:
"""Recursively traverses a nested collection of Pulumi ``Resource`` s, converting them into a flat set which can be
more easily iterated over.
:param item: Either a Pulumi ``Resource`` object, or some collection thereof. The following types of collections are
supported: ``dict``, ``list``, ``ThunderbirdComponentResource``.
:param item: An item which we intend to flatten. Must be one of the recognized types or collections defined in
the Flattenable type alias.
:type item: dict | list | ThunderbirdComponentResource
:return: A ``set`` of Pulumi ``Resource`` s contained within the collection.
Expand Down

0 comments on commit 8a9f5aa

Please sign in to comment.