# SET

### Description

The `set` operator converts a list to a set (in the Python sense).

### Example removing Duplicates

```
list(set([1, 1, 1]))
```

Returns `[1]` since a set cannot contain duplicates

### Example to speed-up Rules

```
large_list := set([87, 737, ..., 1])
42 in large_list
```

will evaluate much faster than directly doing `in` on the list, since a set can check if something is part of it in O(1) (see [Big O Notation](https://en.wikipedia.org/wiki/Big_O_notation))


---

# Agent Instructions: 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:

```
GET https://docs.atfinity.io/rule-language/operators/list-operators/set.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
