From b10f86dbd0fb35379200567a2efc0dbbc83f8997 Mon Sep 17 00:00:00 2001 From: pardouin <116360248+pardouin@users.noreply.github.com> Date: Mon, 29 Jul 2024 00:20:15 +0200 Subject: [PATCH] Update DOCS.md Fixed a typo. --- DOCS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOCS.md b/DOCS.md index a3472835..2270efb4 100644 --- a/DOCS.md +++ b/DOCS.md @@ -1006,7 +1006,7 @@ Coconut also allows a single `?` before attribute access, function calling, part When using a `None`-aware operator for member access, either for a method or an attribute, the syntax is `obj?.method()` or `obj?.attr` respectively. `obj?.attr` is equivalent to `obj.attr if obj is not None else obj`. This does not prevent an `AttributeError` if `attr` is not an attribute or method of `obj`. -The `None`-aware indexing operator is used identically to normal indexing, using `?[]` instead of `[]`. `seq?[index]` is equivalent to the expression `seq[index] is seq is not None else seq`. Using this operator will not prevent an `IndexError` if `index` is outside the bounds of `seq`. +The `None`-aware indexing operator is used identically to normal indexing, using `?[]` instead of `[]`. `seq?[index]` is equivalent to the expression `seq[index] if seq is not None else seq`. Using this operator will not prevent an `IndexError` if `index` is outside the bounds of `seq`. Coconut also supports None-aware [pipe operators](#pipes) and [function composition pipes](#function-composition).