canonical / canonical/craft-cli

`humanize_list` accepts any value that can be coerced to a string for the last list item

Open
#413 2 comments 0 reactions 0 assignees View on GitHub
Type: Bug
Dominant language
Python
Stars
16
Forks
27
Avg merge
2d 1h
Merged PRs (30d)
12

Description

### Bug Description

This should raise a TypeError but it doesn't:

```
>>> craft_cli.utils.humanize_list(['1', 2])
'1, and 2'
```

While this isn't exactly a big deal, it is an unexpected success that can mislead developers.

### To Reproduce

```
craft_cli.utils.humanize_list(['1', 2])
```

### part yaml

```shell

```

### Relevant log output

```shell
n/a
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.