mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-10-10 23:29:18 +08:00
Update type of BinaryField to include memoryview as well (#686)
This commit is contained in:
1 parent
8da8ab4862
commit
695a7d71a7
2 files changed
+10
-1
No files matched your search
@@ -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