Skip to content

Commit

Permalink
Update DOCS.md (#849)
Browse files Browse the repository at this point in the history
Fixed a typo.
  • Loading branch information
evhub authored Jul 28, 2024
2 parents 5f8bc6c + b10f86d commit 143e568
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down

0 comments on commit 143e568

Please sign in to comment.