Commit Graph
6 Commits
Author SHA1 Message Date
David Euresti 097e9f5e71 Fix issue with attrib ordering. (#1980)
A call like this:

```
from attr import attrib
from attr.validators import optional, instance_of

c = attrib(default=None, validator=optional(instance_of(bytes)))
```

Was returning no return value, because the first overload was T -> T.
The solution was to change the ordering so that the first overload is
None -> T and infer the type from the other arguments.
2018-03-22 10:50:07 -07:00
David Euresti df65f6ea15 Better type for click 'type' argument (#1903)
The call accepts tuples of types and callback methods
2018-03-06 21:41:21 -08:00
David Euresti 50c7188300 Work around mypy issue #4554 in attr.Factory (#1933)
This makes the following not give a type error:

   y: DefaultDict[str, List[int]] = Factory(lambda: defaultdict(list))
2018-03-05 19:21:14 -08:00
David Euresti 61e63293f1 Work around mypy issue #4554 in attrs. (#1914) 2018-02-24 13:00:15 -08:00
David Euresti 8ecb74012a Add __divmod__ to numeric types (#1900)
Helps with #1889
2018-02-18 16:59:12 -08:00
David Euresti fe5e12795f Fix signature of CaseInsensitiveDict (#1873)
The values can be more than just strings.
2018-02-11 08:19:39 -08:00