New submission from Tom Forbes <t...@tomforb.es>:

`functools.lru_cache` has a maxsize=128 default for all functions.

If a function has no arguments then this maxsize default is redundant and 
should be set to `maxsize=None`:

```
@functools.lru_cache()
def function_with_no_args():
    pass
```

Currently you need to add `maxsize=None` manually, and ensure that it is also 
updated if you alter the function to add arguments.

----------
components: Library (Lib)
messages: 373542
nosy: Tom Forbes
priority: normal
severity: normal
status: open
title: lru_cache on 0-arity functions should default to maxsize=None
type: performance
versions: Python 3.10

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue41280>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to