mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-26 05:41:11 +08:00
Update type of BinaryField to include memoryview as well (#686)
This commit is contained in:
@@ -165,3 +165,12 @@
|
||||
reveal_type(book.published) # N: Revealed type is "main.Year*"
|
||||
def accepts_int(arg: int) -> None: ...
|
||||
accepts_int(book.published)
|
||||
|
||||
- case: test_binary_field_return_types
|
||||
main: |
|
||||
from django.db import models
|
||||
class EncodedMessage(models.Model):
|
||||
message = models.BinaryField()
|
||||
obj = EncodedMessage(b'\x010')
|
||||
|
||||
reveal_type(obj.message) # N: Revealed type is "Union[builtins.bytes, builtins.memoryview]"
|
||||
|
||||
Reference in New Issue
Block a user