-
Notifications
You must be signed in to change notification settings - Fork 4
/
python-mypy.changes
1694 lines (1534 loc) · 111 KB
/
python-mypy.changes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
-------------------------------------------------------------------
Fri Mar 22 13:48:55 UTC 2024 - Matej Cepl <mcepl@cepl.eu>
- Clean up SPEC file.
-------------------------------------------------------------------
Mon Mar 18 14:33:02 UTC 2024 - Dan Čermák <dcermak@suse.com>
New upstream release 1.9.0
#### Breaking Changes
Because the version of typeshed we use in mypy 1.9 doesn't support 3.7, neither does mypy 1.9. (Jared Hance, PR [16883](https://github.com/python/mypy/pull/16883))
We are planning to enable
[local partial types](https://mypy.readthedocs.io/en/stable/command_line.html#cmdoption-mypy-local-partial-types) (enabled via the
`--local-partial-types` flag) later this year by default. This change
was announced years ago, but now it's finally happening. This is a
major backward-incompatible change, so we'll probably include it as
part of the upcoming mypy 2.0 release. This makes daemon and
non-daemon mypy runs have the same behavior by default.
Local partial types can also be enabled in the mypy config file:
```
local_partial_types = True
```
We are looking at providing a tool to make it easier to migrate
projects to use `--local-partial-types`, but it's not yet clear whether
this is practical. The migration usually involves adding some
explicit type annotations to module-level and class-level variables.
#### Basic Support for Type Parameter Defaults (PEP 696)
This release contains new experimental support for type parameter
defaults ([PEP 696](https://peps.python.org/pep-0696)). Please try it
out! This feature was contributed by Marc Mueller.
Since this feature will be officially introduced in the next Python
feature release (3.13), you will need to import `TypeVar`, `ParamSpec`
or `TypeVarTuple` from `typing_extensions` to use defaults for now.
This example adapted from the PEP defines a default for `BotT`:
```python
from typing import Generic
from typing_extensions import TypeVar
class Bot: ...
BotT = TypeVar("BotT", bound=Bot, default=Bot)
class Context(Generic[BotT]):
bot: BotT
class MyBot(Bot): ...
# type is Bot (the default)
reveal_type(Context().bot)
# type is MyBot
reveal_type(Context[MyBot]().bot)
```
#### Type-checking Improvements
* Fix missing type store for overloads (Marc Mueller, PR [16803](https://github.com/python/mypy/pull/16803))
* Fix `'WriteToConn' object has no attribute 'flush'` (Charlie Denton, PR [16801](https://github.com/python/mypy/pull/16801))
* Improve TypeAlias error messages (Marc Mueller, PR [16831](https://github.com/python/mypy/pull/16831))
* Support narrowing unions that include `type[None]` (Christoph Tyralla, PR [16315](https://github.com/python/mypy/pull/16315))
* Support TypedDict functional syntax as class base type (anniel-stripe, PR [16703](https://github.com/python/mypy/pull/16703))
* Accept multiline quoted annotations (Shantanu, PR [16765](https://github.com/python/mypy/pull/16765))
* Allow unary + in `Literal` (Jelle Zijlstra, PR [16729](https://github.com/python/mypy/pull/16729))
* Substitute type variables in return type of static methods (Kouroche Bouchiat, PR [16670](https://github.com/python/mypy/pull/16670))
* Consider TypeVarTuple to be invariant (Marc Mueller, PR [16759](https://github.com/python/mypy/pull/16759))
* Add `alias` support to `field()` in `attrs` plugin (Nikita Sobolev, PR [16610](https://github.com/python/mypy/pull/16610))
* Improve attrs hashability detection (Tin Tvrtković, PR [16556](https://github.com/python/mypy/pull/16556))
#### Performance Improvements
* Speed up finding function type variables (Jukka Lehtosalo, PR [16562](https://github.com/python/mypy/pull/16562))
#### Documentation Updates
* Document supported values for `--enable-incomplete-feature` in "mypy --help" (Froger David, PR [16661](https://github.com/python/mypy/pull/16661))
* Update new type system discussion links (thomaswhaley, PR [16841](https://github.com/python/mypy/pull/16841))
* Add missing class instantiation to cheat sheet (Aleksi Tarvainen, PR [16817](https://github.com/python/mypy/pull/16817))
* Document how evil `--no-strict-optional` is (Shantanu, PR [16731](https://github.com/python/mypy/pull/16731))
* Improve mypy daemon documentation note about local partial types (Makonnen Makonnen, PR [16782](https://github.com/python/mypy/pull/16782))
* Fix numbering error (Stefanie Molin, PR [16838](https://github.com/python/mypy/pull/16838))
* Various documentation improvements (Shantanu, PR [16836](https://github.com/python/mypy/pull/16836))
#### Stubtest Improvements
* Ignore private function/method parameters when they are missing from the stub (private parameter names start with a single underscore and have a default) (PR [16507](https://github.com/python/mypy/pull/16507))
* Ignore a new protocol dunder (Alex Waygood, PR [16895](https://github.com/python/mypy/pull/16895))
* Private parameters can be omitted (Sebastian Rittau, PR [16507](https://github.com/python/mypy/pull/16507))
* Add support for setting enum members to "..." (Jelle Zijlstra, PR [16807](https://github.com/python/mypy/pull/16807))
* Adjust symbol table logic (Shantanu, PR [16823](https://github.com/python/mypy/pull/16823))
* Fix posisitional-only handling in overload resolution (Shantanu, PR [16750](https://github.com/python/mypy/pull/16750))
#### Stubgen Improvements
* Fix crash on star unpack of TypeVarTuple (Ali Hamdan, PR [16869](https://github.com/python/mypy/pull/16869))
* Use PEP 604 unions everywhere (Ali Hamdan, PR [16519](https://github.com/python/mypy/pull/16519))
* Do not ignore property deleter (Ali Hamdan, PR [16781](https://github.com/python/mypy/pull/16781))
* Support type stub generation for `staticmethod` (WeilerMarcel, PR [14934](https://github.com/python/mypy/pull/14934))
-------------------------------------------------------------------
Tue Jan 2 17:24:56 UTC 2024 - Dirk Müller <dmueller@suse.com>
- update to 1.8.0:
* https://mypy-lang.blogspot.com/2023/12/mypy-18-released.html
* https://mypy-lang.blogspot.com/2023/11/mypy-17-released.html
* https://mypy-lang.blogspot.com/2023/10/mypy-16-released.html
- fix dependencies
-------------------------------------------------------------------
Wed Aug 30 18:31:19 UTC 2023 - Martin Schreiner <martin.schreiner@suse.com>
- Update to 1.5.1:
- stubtest: Fix __mypy-replace false positives.
- Update typing_extensions stubs.
- Update test suite dependencies:
- types_psutil_version 5.9.5.15 -> 5.9.5.16
- types_setuptools_version 68.0.0.2 -> 68.0.0.1
- Rename package from mypy to python-mypy.
- Rename .spec, .changes and rpmlintrc files, accordingly.
- Adjust rpmlintrc.
-------------------------------------------------------------------
Sun Aug 13 06:30:29 UTC 2023 - Sebastian Wagner <sebix@sebix.at>
- update to version 1.5.0:
- Drop Support for Python 3.7
- Mypy no longer supports running with Python 3.7, which has reached end-of-life. This was contributed by Shantanu (PR 15566).
- Optional Check to Require Explicit @override
- If you enable the explicit-override error code, mypy will generate an error if a method override doesn’t use the @typing.override decorator (as discussed in PEP 698). This way mypy will detect accidentally introduced overrides.
- You can enable the error code via --enable-error-code=explicit-override on the mypy command line or enable_error_code = explicit-override in the mypy config file.
- The override decorator will be available in typing in Python 3.12, but you can also use the backport from a recent version of typing_extensions on all supported Python versions.
- More Flexible TypedDict Creation and Update
- Mypy was previously overly strict when type checking TypedDict creation and update operations. Though these checks were often technically correct, they sometimes triggered for apparently valid code. These checks have now been relaxed by default. You can enable stricter checking by using the new --extra-checks flag.
- Deprecated Flag: --strict-concatenate
- The behavior of --strict-concatenate is now included in the new --extra-checks flag, and the old flag is deprecated.
- Optionally Show Links to Error Code Documentation
- If you use --show-error-code-links, mypy will add documentation links to (many) reported errors. The links are not shown for error messages that are sufficiently obvious, and they are shown once per error code only.
- Consistently Avoid Type Checking Unreachable Code
- If a module top level has unreachable code, mypy won’t type check the unreachable statements. This is consistent with how functions behave. The behavior of --warn-unreachable is also more consistent now.
- Experimental Improved Type Inference for Generic Functions
- You can use --new-type-inference to opt into an experimental new type inference algorithm. It fixes issues when calling a generic functions with an argument that is also a generic function, in particular. This current implementation is still incomplete, but we encourage trying it out and reporting bugs if you encounter regressions. We are planning to enable the new algorithm by default in a future mypy release.
- Partial Support for Python 3.12
- Mypy and mypyc now support running on recent Python 3.12 development versions. Not all new Python 3.12 features are supported, and we don’t ship compiled wheels for Python 3.12 yet.
- Improvements to Dataclasses
- Improve signature of dataclasses.replace (Ilya Priven, PR 14849)
- Fix dataclass/protocol crash on joining types (Ilya Priven, PR 15629)
- Fix strict optional handling in dataclasses (Ivan Levkivskyi, PR 15571)
- Support optional types for custom dataclass descriptors (Marc Mueller, PR 15628)
- Add __slots__ attribute to dataclasses (Nikita Sobolev, PR 15649)
- Support better __post_init__ method signature for dataclasses (Nikita Sobolev, PR 15503)
- Mypyc Improvements
- Support unsigned 8-bit native integer type: mypy_extensions.u8 (Jukka Lehtosalo, PR 15564)
- Support signed 16-bit native integer type: mypy_extensions.i16 (Jukka Lehtosalo, PR 15464)
- Define mypy_extensions.i16 in stubs (Jukka Lehtosalo, PR 15562)
- Document more unsupported features and update supported features (Richard Si, PR 15524)
- Fix final NamedTuple classes (Richard Si, PR 15513)
- Use C99 compound literals for undefined tuple values (Jukka Lehtosalo, PR 15453)
- Don't explicitly assign NULL values in setup functions (Logan Hunt, PR 15379)
- Stubgen Improvements
- Teach stubgen to work with complex and unary expressions (Nikita Sobolev, PR 15661)
- Support ParamSpec and TypeVarTuple (Ali Hamdan, PR 15626)
- Fix crash on non-str docstring (Ali Hamdan, PR 15623)
- Documentation Updates
- Add documentation for additional error codes (Ivan Levkivskyi, PR 15539)
- Improve documentation of type narrowing (Ilya Priven, PR 15652)
- Small improvements to protocol documentation (Shantanu, PR 15460)
- Remove confusing instance variable example in cheat sheet (Adel Atallah, PR 15441)
- Other Notable Fixes and Improvements
- Constant fold additional unary and binary expressions (Richard Si, PR 15202)
- Exclude the same special attributes from Protocol as CPython (Kyle Benesch, PR 15490)
- Change the default value of the slots argument of attrs.define to True, to match runtime behavior (Ilya Priven, PR 15642)
- Fix type of class attribute if attribute is defined in both class and metaclass (Alex Waygood, PR 14988)
- Handle type the same as typing.Type in the first argument of classmethods (Erik Kemperman, PR 15297)
- Fix --find-occurrences flag (Shantanu, PR 15528)
- Fix error location for class patterns (Nikita Sobolev, PR 15506)
- Fix re-added file with errors in mypy daemon (Ivan Levkivskyi, PR 15440)
- Fix dmypy run on Windows (Ivan Levkivskyi, PR 15429)
- Fix abstract and non-abstract variant error for property deleter (Shantanu, PR 15395)
- Remove special casing for "cannot" in error messages (Ilya Priven, PR 15428)
- Add runtime __slots__ attribute to attrs classes (Nikita Sobolev, PR 15651)
- Add get_expression_type to CheckerPluginInterface (Ilya Priven, PR 15369)
- Remove parameters that no longer exist from NamedTuple._make() (Alex Waygood, PR 15578)
- Allow using typing.Self in __new__ with an explicit @staticmethod decorator (Erik Kemperman, PR 15353)
- Fix self types in subclass methods without Self annotation (Ivan Levkivskyi, PR 15541)
- Check for abstract class objects in tuples (Nikita Sobolev, PR 15366)
- Typeshed Updates
- Typeshed is now modular and distributed as separate PyPI packages for everything except the standard library stubs. Please see git log for full list of typeshed changes.
-------------------------------------------------------------------
Sun Jul 16 08:34:41 UTC 2023 - Sebastian Wagner <sebix@sebix.at>
- Update to 1.4.1
- disable pep561 tests, as they fail on Python 3.11.4, see https://github.com/python/mypy/issues/15446
-------------------------------------------------------------------
Tue Jun 20 20:50:48 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.4.0:
- The Override Decorator
- Propagating Type Narrowing to Nested Functions
- Narrowing Enum Values Using “==”
- Performance Improvements
-------------------------------------------------------------------
Thu May 11 06:02:09 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Skip over failing testMathOps (gh#python/mypy#15221).
-------------------------------------------------------------------
Wed May 10 20:36:45 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.3.0:
- Improve performance of union subtyping
- Add negative subtype caches
- Stubtest: Check that the stub is abstract if the runtime is,
even when the stub is an overloaded method
- Stubtest: Verify stub methods or properties are decorated
with @final if they are decorated with @final at runtime
- Stubtest: Fix stubtest false positives with TypedDicts at
runtime
- Stubgen: Support @functools.cached_property
- Improvements to stubgenc
- Add support for converters with TypeVars on generic attrs
classes
- Fix attrs.evolve on bound TypeVar
- Improve async documentation
- Improvements to cheat sheet
- Add documentation for bytes formatting error code
- Convert insecure links to use HTTPS
- Also mention overloads in async iterator documentation
- stubtest: Improve allowlist documentation
- Clarify "Using types... but not at runtime"
- Fix alignment of cheat sheet example
- Fix error for callback protocol matching against callable
type object
- Improve bytes formatting error
- Fix unions of bools and ints
- Fix narrowing union types that include Self with isinstance
- Allow objects matching SupportsKeysAndGetItem to be unpacked
- Check type guard validity for staticmethods
- Fix sys.platform when cross-compiling with emscripten
-------------------------------------------------------------------
Mon May 8 13:56:42 UTC 2023 - Johannes Kastl <kastl@b1-systems.de>
- add sle15_python_module_pythons
-------------------------------------------------------------------
Sun May 7 09:54:51 UTC 2023 - Sebastian Wagner <sebix@sebix.at>
- update typed_ast to version 1.5.8.6
- update types_psutil to version 5.9.5.12
- update types_setuptools to version 67.7.0.1
- fix "E: wrong-script-end-of-line-encoding" and "E: spurious-executable-perm" for docs/make.bat
- fix "W: python-doc-in-package" for %{$python_sitelib}/mypyc/doc in Python 3.9, 3.10 and 3.11
- update mypy to version 1.2.0:
- Improvements to Dataclass Transforms
- Support implicit default for "init" parameter in field specifiers (Wesley Collin Wright and Jukka Lehtosalo, PR 15010)
- Support descriptors in dataclass transform (Jukka Lehtosalo, PR 15006)
- Fix frozen_default in incremental mode (Wesley Collin Wright)
- Fix frozen behavior for base classes with direct metaclasses (Wesley Collin Wright, PR 14878)
- Mypyc: Native Floats
- Mypyc now uses a native, unboxed representation for values of type float. Previously these were heap-allocated Python objects. Native floats are faster and use less memory. Code that uses floating-point operations heavily can be several times faster when using native floats.
- Various float operations and math functions also now have optimized implementations. Refer to the documentation for a full list.
- This can change the behavior of existing code that uses subclasses of float. When assigning an instance of a subclass of float to a variable with the float type, it gets implicitly converted to a float instance when compiled
- Previously, implicit conversions were applied to int subclasses but not float subclasses.
- Also, int values can no longer be assigned to a variable with type float in compiled code, since these types now have incompatible representations. An explicit conversion is required.
- This restriction only applies to assignments, since they could otherwise narrow down the type of a variable from float to int. int values can still be implicitly converted to float when passed as arguments to functions that expect float values.
- Note that mypyc still doesn’t support arrays of unboxed float values. Using list[float] involves heap-allocated float objects, since list can only store boxed values. Support for efficient floating point arrays is one of the next major planned mypyc features.
- Related changes:
- Use a native unboxed representation for floats (Jukka Lehtosalo, PR 14880)
- Document native floats and integers (Jukka Lehtosalo, PR 14927)
- Fixes to float to int conversion (Jukka Lehtosalo, PR 14936)
- Mypyc: Native Integers
- Mypyc now supports signed 32-bit and 64-bit integer types in addition to the arbitrary-precision int type. You can use the types mypy_extensions.i32 and mypy_extensions.i64 to speed up code that uses integer operations heavily.
- Refer to the documentation for more information. This feature was contributed by Jukka Lehtosalo.
- Other Mypyc Fixes and Improvements
- Support iterating over a TypedDict (Richard Si, PR 14747)
- Faster coercions between different tuple types (Jukka Lehtosalo, PR 14899)
- Faster calls via type aliases (Jukka Lehtosalo, PR 14784)
- Faster classmethod calls via cls (Jukka Lehtosalo, PR 14789)
- Fixes to Crashes
- Fix crash on class-level import in protocol definition (Ivan Levkivskyi, PR 14926)
- Fix crash on single item union of alias (Ivan Levkivskyi, PR 14876)
- Fix crash on ParamSpec in incremental mode (Ivan Levkivskyi, PR 14885)
- Documentation Updates
- Update adopting --strict documentation for 1.0 (Shantanu, PR 14865)
- Some minor documentation tweaks (Jukka Lehtosalo, PR 14847)
- Improve documentation of top level mypy: disable-error-code comment (Nikita Sobolev, PR 14810)
- Error Reporting Improvements
- Add error code to typing_extensions suggestion (Shantanu, PR 14881)
- Add a separate error code for top-level await (Nikita Sobolev, PR 14801)
- Don’t suggest two obsolete stub packages (Jelle Zijlstra, PR 14842)
- Add suggestions for pandas-stubs and lxml-stubs (Shantanu, PR 14737)
- Other Fixes and Improvements
- Multiple inheritance considers callable objects as subtypes of functions (Christoph Tyralla, PR 14855)
- stubtest: Respect @final runtime decorator and enforce it in stubs (Nikita Sobolev, PR 14922)
- Fix false positives related to type[<type-var>] (sterliakov, PR 14756)
- Fix duplication of ParamSpec prefixes and properly substitute ParamSpecs (EXPLOSION, PR 14677)
- Fix line number if __iter__ is incorrectly reported as missing (Jukka Lehtosalo, PR 14893)
- Fix incompatible overrides of overloaded generics with self types (Shantanu, PR 14882)
- Allow SupportsIndex in slice expressions (Shantanu, PR 14738)
- Support if statements in bodies of dataclasses and classes that use dataclass_transform (Jacek Chałupka, PR 14854)
- Allow iterable class objects to be unpacked (including enums) (Alex Waygood, PR 14827)
- Fix narrowing for walrus expressions used in match statements (Shantanu, PR 14844)
- Add signature for attr.evolve (Ilya Konstantinov, PR 14526)
- Fix Any inference when unpacking iterators that don't directly inherit from typing.Iterator (Alex Waygood, PR 14821)
- Fix unpack with overloaded __iter__ method (Nikita Sobolev, PR 14817)
- Reduce size of JSON data in mypy cache (dosisod, PR 14808)
- Improve “used before definition” checks when a local definition has the same name as a global definition (Stas Ilinskiy, PR 14517)
- Honor NoReturn as __setitem__ return type to mark unreachable code (sterliakov, PR 12572)
-------------------------------------------------------------------
Wed Apr 12 12:37:48 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.1.1:
- Support for dataclass_transform (as defined in PEP-681).
- Dedicated Error Code for Method Assignments
- Stubgen improvements
- Stubtest improvements
- Typeshed updates
- Plenty of fixes
- Removed upstreamed patch testI64Cast-fix.patch
-------------------------------------------------------------------
Tue Apr 11 07:15:55 UTC 2023 - Steve Kowalik <steven.kowalik@suse.com>
- Sadly, six is still required for tests, re-add to BuildRequires.
-------------------------------------------------------------------
Tue Feb 14 06:02:49 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Don't skip the test, add testI64Cast-fix.patch to make it
working (gh#python/mypy#14691).
-------------------------------------------------------------------
Tue Feb 7 13:56:17 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Skip failing test testI64Cast (gh#python/mypy#14633).
-------------------------------------------------------------------
Tue Feb 7 08:42:15 UTC 2023 - Matej Cepl <mcepl@suse.com>
- Update to 1.0.0 (YAY!):
- Mypy 1.0 is up to 40% faster than mypy 0.991 when type
checking the Dropbox internal codebase. We also set up a
daily job to measure the performance of the most recent
development version of mypy to make it easier to track
changes in performance.
- Warn About Variables Used Before Definition
- Detect Possibly Undefined Variables (Experimental)
- Support the “Self” Type
- Support ParamSpec in Type Aliases
- ParamSpec and Generic Self Types No Longer Experimental
- Miscellaneous New Features
- plenty of bug fixes
-------------------------------------------------------------------
Tue Jan 24 11:50:12 UTC 2023 - Daniel Garcia <daniel.garcia@suse.com>
- Update to 0.991
- Basic Python 3.11 Support
- Breaking Change: No Implicit Optional Types for Arguments
- Breaking Change: Namespace Packages Enabled by Default
- Recursive Types Enabled By Default
- Error Codes Shown by Default
- Safe Handling of Empty Function Bodies
- Enabling Experimental Features Individually
- Configuring Packages/Modules in the Config File
- Warn about Variable Annotations in Unchecked Functions
- Error Code for Using an Abstract Class as type[T]
- Performance Improvements
- Changes to Error Reporting and Messages
-------------------------------------------------------------------
Tue Sep 27 16:01:57 UTC 2022 - Daniel Garcia <daniel.garcia@suse.com>
- Remove mypy-pr13259-walrus.patch because it's not needed anymore, it's in the
release now -- gh#python/mypy#13259
- Update to 0.981
- Drop support for Python3.6 and python2
- Generate Error on Unbound TypeVar Return Type
- Methods with Empty Bodies in Protocols Are Abstract
- Implicit Optional Types Will Be Disabled by Default
- Precise Types for **kwds Using TypedDict
- Experimental Support for General Recursive Types
- Generic NamedTuples and TypedDicts
- Better Support for Callable Attributes
- Per-Module Error Code Configuration
- Experimental Support for Interactive Inspection of Expressions
- Mypyc Improvements
* Support async for as a statement and in comprehensions (Michael J.
Sullivan, PR 13444)
* Support async with (Michael J. Sullivan, PR 13442)
* Fix clang warning on different signs integer (Paul m. p. Peny, PR 13239)
* Fix AttributeError message (Jukka Lehtosalo, PR 13382)
* Fix __call__ subclasses (Ken Jin, PR 13152)
* Fix setup conflict with attributes named up (davfsa, PR 13012)
* Fix bad C generated for multiple assignment (Jukka Lehtosalo, PR 13147)
* Update, simplify check version test (Shantanu, PR 13125)
The full release notes can be found here:
https://mypy-lang.blogspot.com/2022/09/mypy-0981-released.html
-------------------------------------------------------------------
Sat Aug 6 15:12:25 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Update Requirements
- Add mypy-pr13259-walrus.patch -- gh#python/mypy#13259
* fix test failures with Python >= 3.10.6
-------------------------------------------------------------------
Sat Aug 6 14:10:01 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Update to 0.971:
- Last Release Officially Supporting Python 2 and 3.6:
- Support for Python 2 will be completely removed in the next
mypy feature release after this one, mypy 0.980.
- Support for Python 3.6 will also be dropped in mypy 0.980,
since Python 3.6 has reached its end of life. It will be
still possible to target Python 3.6 using --python-version
in future mypy versions, but no bugs will be fixed that
affect only Python 3.6 (unless they are regressions). Also
note that typeshed just recently dropped Python 3.6
support, so standard library features only available in
Python 3.6 will not be supported.
on https://mypy-lang.blogspot.com/2022/07/mypy-0971-released.html
- Mypyc Improvements and Fixes
* Speed up accessing always defined native attributes (Jukka
Lehtosalo, PR 12600)
* Reduce the overhead of reference counting (Jukka Lehtosalo,
PR 12805, PR 12810, PR 12817)
* Fix Python 3.11 C API errors (97littleleaf11, PR 12850)
* Generate smaller code for casts and some implicit type
coercions (Jukka Lehtosalo, PR 12839)
* Optimize calling Python objects with zero or one arguments
(97littleleaf11, PR 12862)
* Replace integer floor division by a power of two with a shift
(Jukka Lehtosalo, PR 12870)
* Add primitives for faster access of float and tuple type
objects (Richard Si, PR 13078)
* Fix compile error related to operator assignment in a
generator function (Zsolt Dollenstein, PR 13144)
- Stubtest Improvements
* Allow ellipsis as default argument (Shantanu, PR 12838)
* Support --version (Shantanu, PR 12852)
* Check type variables and ParamSpecs (Shantanu, PR 12851)
* Add error summary and other output tweaks (KotlinIsland, PR
12855)
- Other Notable Fixes and Improvements
* Disallow assignments to awaited coroutines that do not return
(Shantanu, PR 12853)
* Search sys.path for PEP 561 compliant packages (Ashley
Whetter, PR 11143)
* Treat generators with await as async (Jared Hance, PR 12925)
* Fix bug in constraints solver regarding ParamSpec upper
bounds (Alex Waygood, PR 12938)
* Fix crash on redefined class variable annotated with
Final[<type>] (Alex Waygood, PR 12951)
* Improve handling of overloads with ParamSpec (Alex Waygood,
PR 12953)
* Don’t suggest installing types packages for some third-party
packages that now include types or are obsolete (Shantanu, PR
12959)
* Add a short note when an error may be fixed by adding an
await (Ivan Levkivskyi, PR 12958)
* Support unannotated converters for attr.ib (t4lz, PR 12815)
* Disallow undesirable implicit reexport with a from import
(Shantanu, PR 12704)
* Fix crash when subclass method has the same name as a type
alias (Wesley Collin Wright, PR 13015)
* Include end column offset in the mypy AST (bruno messias, PR
12972)
* Fix "attribute 'arguments' of 'FuncDef' undefined"
incremental crash (Frédéric Perrin, PR 12324)
* Fix false positive error on multiple enum base classes (Alex
Waygood, PR 12963)
* Don't add __match_args__ for dataclasses and named tuples on
Python versions lower than 3.10 (Stanislav K, PR 12503)
* Fix crash when overriding partial-type attribute with method
(Jake Lishman, PR 12943)
* Fix editable installs to current working directory (Shantanu,
PR 13161)
- Typeshed is now modular and distributed as separate PyPI
packages for everything except the standard library stubs.
Please see git log for full list of typeshed changes.
-------------------------------------------------------------------
Tue Jun 21 09:00:36 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
- remove obsolete patch 12452-stringent-err-msg.patch
- update to version 0.960:
- Recognise typing.LiteralString and typing_extensions.LiteralString as aliases to str.
- This does not add proper support for LiteralString, but this allows it to be used in type annotations and stubs. LiteralString will be included in Python 3.11 (PEP 675), and it can be used to require that a value is an arbitrary literal string (once fully supported).
- Per-file Timing Stats
- When mypy is run with the (currently hidden) --timing-stats FILE option, mypy will record detailed information about time spent type checking each file (microseconds). When profiling mypy runs over a large codebase, it can be useful to know which files are the slowest to type check. We are happy to receive bug reports about unexpectedly slow type checking.
- Performance Improvements
- Cache type of container literals when possible (Hugues, PR 12707)
- Speed up type checking of nested if expressions (Hugues, PR 12700)
- Speed up type checking of container literals with tuple entries (Hugues, PR 12706)
- Speed up argument count check (Hugues, PR 12703)
- Speed up processing large error counts and improve error filtering (Hugues, PR 12631)
- Experimental Fast Module Lookup
- Use the new --fast-module-lookup to switch to an alternative import resolution implementation that is faster when a large number of folders share a top-level namespace. We’d like to hear if you notice an improvement when using this flag, so that we can potentially prioritize work to enable this by default.
- Documentation Updates
- Add information about classes and types to “Getting started” (Michael Lee, PR 6557)
- Mention no_type_check decorator in documentation (Shantanu, PR 12713)
- Remove most mentions of type comments from docs (Shantanu, PR 12683)
- Use PEP 585 syntax in "The type of class objects" (Alex Waygood, PR 12516)
- Improvements to Plugin System
- Add a class attribute hook to the plugin system (Danny Weinberg, PR 9881)
- Add an alternative class decorator hook that is less error-prone than the old one (Jukka Lehtosalo, PR 12762)
- ParamSpec Improvements
- Friendlier errors for ParamSpec (PEP 612) (Shantanu, PR 12832)
- Fix ParamSpec crash related to Any types (EXPLOSION, PR 12548)
- Use tuple[object, ...] and dict[str, object] as upper bounds for ParamSpec.args and ParamSpec.kwargs (Alex Waygood, PR 12668)
- Fixes to Crashes
- Fix crash on invalid Python executable (Pranav Rajpal, PR 12812)
- Fix crash on type alias definition inside dataclass declaration (Alex Waygood, PR 12792)
- Fix crash related to namedtuple in unannotated function (Jukka Lehtosalo, PR 12804)
- Fix nested namedtuple crash in incremental mode (Jukka Lehtosalo, PR 12803)
- Fix forward references and generic inheritance in attrs classes (Jukka Lehtosalo, PR 12772)
- mypyc: Fix TypeError in lambda argument to overloaded function (Jukka Lehtosalo, PR 12780)
- Fix crashes related to functools.total_ordering and forward references (Jukka Lehtosalo, PR 12767)
- Fix crashes related to dataclasses and forward references (Jukka Lehtosalo, PR 12762)
- Fix crash on invalid TypedDict definition (Alex Waygood, PR 12741)
- Fix crash when using decorator in class scope (dzcode, PR 12724)
- Other Notable Fixes and Improvements
- Fix type annotation support of dunder methods in stubgen (Fabian Keller, PR 12828)
- Fix some value patterns in match statements to be non-exhaustive (Štěpán Horáček, PR 12751)
- Generate error when using both abstractmethod and final (Tomoki Nakagawa, PR 12743)
- Add more precise error message for Callable annotation (frerikandriessen, PR 12518)
- Fix generic inference in functions with TypeGuard (Nikita Sobolev, PR 11797)
- Add check if python_version was parsed as float in pyproject.toml (Marcel Otoboni, PR 12558)
- Fix nested overload merging (Marc Mueller, PR 12607)
- stubtest: Generate error if type alias doesn't exist at runtime (Alex Waygood, PR 12608)
- Support typing_extensions.overload (Jelle Zijlstra, PR 12602)
- update to version 0.950:
- Recent third-party library stubs available via types-* packages (e.g. types-requests) are actively using recent typing features that may not be supported by older mypy releases. We recommend that if you pin mypy to a specific version, you should also pin any stub packages to a version no more recent than the mypy release. Otherwise the mypy version you use may silently fall back to Any types if it encounters annotation syntax that it can’t process. It’s fine to continue using older versions of stubs when you upgrade mypy.
- Note also that recent versions of many third-party stub packages don’t support Python 2 any more. If you are using mypy to type check Python 2 code, it’s important to pin all stub packages to versions that still support Python 2. Generally stub package versions: in Feb 2022 or earlier still support Python 2 (assuming that they supported Python 2 at all).
- New Features: Concatenate and Literals with ParamSpec
- It’s now possible to precisely annotate decorators that add/remove arguments, using ParamSpec together with typing.Concatenate (Python 3.10 or later) or typing_extensions.Concatenate. The decorator in this example provides an implicit Request argument to the decorated function.
- New Feature: Detect Unused Coroutines and Awaitables
- Now mypy will give an error if you forget to await a coroutine:
- If you enable the unused-awaitable error code, mypy will also complain about any unused value that supports __await__. This is not enabled by default, since this can cause false positives.
- New Feature: assert_type
- You can now use typing_extensions.assert_type to ask mypy to validate that an expression has a specific static type. Mypy will report an error if the inferred type is not as expected:
- from typing_extensions import assert_type
- assert_type([1], list[int]) # OK
- # Error: Expression is of type "List[int]", not "List[str]"
- assert_type([1], list[str])
- This can be used to validate that the expected type is inferred by mypy when calling a complex overloaded function, for example. At runtime assert_type just returns the first argument and doesn’t perform a runtime type check.
- Mypyc Fixes and Improvements
- Fix overflow in id built-in (Ekin Dursun, PR 12332)
- Simplify generated code for native attribute get (Jukka Lehtosalo, PR 11978)
- Implement close method for generators (Max Shvets, PR 12042)
- Use more accurate flags with msvc (KotlinIsland, PR 12468)
- Fix potential memory leak with setdefault() (Jukka Lehtosalo, PR 12514)
- Make boxed integer constants/literals faster (Jukka Lehtosalo, PR 12507)
- Performance Improvements
- Mypy now type checks somewhat faster, in particular when dealing with enums and unions with many items.
- Speed up union types (Jukka Lehtosalo, PR 12541, PR 12519)
- Speed up subtype checks (Jukka Lehtosalo, PR 12540, PR 12538, PR 12536, PR 12539)
- Speed up type checking enums (Hugues, PR 12032)
- Speed up union types further (Hugues, PR 12630)
- Documentation Improvements
- Use Furo theme for documentation (97littleleaf11, PR 12348)
- Add missing enable_error_code to config documentation (Mathieu Kniewallner, PR 12346)
- Correct example in “Annotation issues at runtime” (Alex Waygood, PR 12356)
- Fix inaccuracy: NoneType is exposed in the types module on Python 3.10+ (Alex Waygood, PR 12515)
- Stubgen Improvements
- Fix handling of Protocol (citruz, PR 12129)
- Use _typeshed.Incomplete instead of typing.Any (Sebastian Rittau, PR 12449)
- Do not consider nested generators (Štěpán Horáček, PR 12463)
- Fix behavior for instance variables in C extensions (Shubham SInghal, PR 12524)
- Stubtest Improvements
- Generate error for read-only property at runtime, but not in stub (Alex Waygood, PR 12291)
- Enable verification of __match_args__ attributes (Alex Waygood, PR 12465)
- Other Notable Fixes and Improvements
- Use tomllib on Python 3.11 (Shantanu, PR 12305)
- Print compilation status with --version (Shantanu, PR 12318)
- Fix __annotations__ being undefined (Niklas Gustafsson, PR 10969)
- Add success message for notes-only output (97littleleaf11, PR 12306)
- dmypy: Warn instead of failing if report generation is configured (Nate McMaster, PR 10181)
- Fix caching of PEP 561 namespace packages with missing submodules (Shantanu, PR 12250)
- Fix empty reveal_locals output (Cibin Mathew, PR 12400)
- Check that async for/with is inside an async function (Štěpán Horáček, PR 12418)
- Recognize Hashable as a real protocol (Nikita Sobolev, PR 11802)
- Remove the * for inferred types from reveal_type output (Stanislav K, PR 12459)
- Unify a codepath in typevarlike semanal (Jared Hance, PR 12480)
- Recognise both attrs and attr package names (Spencer Brown, PR 12469)
- Fix Callable attributes in frozen dataclasses (Jordan Speicher, PR 12383)
- Improve checking of __slots__ (Jukka Lehtosalo, PR 12531)
- Avoid conflicts between type variables defined in different classes (Jukka Lehtosalo, PR 12590)
- Fix __slots__ and __deletable__ in incremental mode (Jukka Lehtosalo, PR 12645)
- Fix issue with ParamSpec serialization (Jukka Lehtosalo, PR 12654)
- Fix types of inherited attributes in generic dataclasses (Jukka Lehtosalo, PR 12656)
-------------------------------------------------------------------
Mon Mar 28 15:33:14 UTC 2022 - Matej Cepl <mcepl@suse.com>
- Add 12452-stringent-err-msg.patch to make mypy work
with more stringent error messages in Python
>= 3.10.3 (gh#python/mypy#12451).
-------------------------------------------------------------------
Fri Mar 25 21:32:58 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.942:
- Fixes to Regressions:
- Let overload item have a more general return type than the implementation (Jukka Lehtosalo, PR 12435)
- Fix inheritance false positives with dataclasses/attrs (Jukka Lehtosalo, PR 12411)
- Support overriding dunder attributes in Enum subclass (Petter Friberg, PR 12138)
- Fix small conditional overload regression (Marc Mueller, PR 12336)
- Other Fixes:
- Fix issues related to the order of processing in the builtins import cycle (Jukka Lehtosalo, PR 12431)
- Fix crash in match statement if class name is undefined (Jukka Lehtosalo, PR 12417)
- Allow non-final __match_args__ and overriding (Jukka Lehtosalo, PR 12415)
-------------------------------------------------------------------
Mon Mar 14 21:44:08 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.941:
- No changelog available.
-------------------------------------------------------------------
Mon Mar 14 21:35:28 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.940:
- Match Statement
Mypy now has experimental support for type checking match statements introduced in Python 3.10.
- Python 2 End-of-Life Schedule
After this release, Python 2 support is in feature freeze. Mypy won’t add new features or fixes specific to type checking Python 2 code, expect for fixes of significant regressions.
Mypy will drop Python 2 support in the second half of 2022.
Important note: Since typeshed is in the process of removing Python 2 specific stubs, you should pin all installed typeshed stub packages for third-party libraries to a version from Feb 2022 or earlier if you want to type check Python 2 code.
- Miscellaneous New Features
- Add support for conditionally defined overloads (Marc Mueller, PR 10712)
- Give "as" variables in with statements separate scopes when it is safe to do so (Jukka Lehtosalo, PR 12254)
- Add an optional error code ignore-without-code to require ignore comments to have error codes (Peter Law, PR 11633)
- Add support for typing.Never and typing_extensions.Never as alternative spellings of NoReturn (Jelle Zijlstra, PR 12153)
- Add support for typing.reveal_type (Jelle Zijlstra, PR 12117)
- Support universal2 macOS wheels (97littleleaf11, PR 10651)
- Add match_args support to attr.s() (Nikita Sobolev, PR 12111)
- Enum Improvements
- Check Enum definition for invalid base classes (Nikita Sobolev, PR 12026)
- Understand the self-destructing nature of Enum._ignore_ (Kenny Stauffer, PR 12128)
- Add StrEnum support for Python 3.11 (Nikita Sobolev, PR 12035)
- Make enum values final (joey-laminar, PR 11962)
- Improve final detection for Enum (Nikita Sobolev, PR 11984)
- Fix Enum final properties and writable special members (Nikita Sobolev, PR 11945)
- Enum now accepts String literals and final values as 2nd argument (Vincent Perez, PR 8664)
- Fix false positive about member name reuse in enum (Max Rossmannek, PR 11972)
- Fix enum inheritance regression (Nikita Sobolev, PR 12260)
- Mypyc Fixes and Improvements
- Use Py_TYPE and Py_IsNone (97littleleaf11, PR 12233)
- Implement additional internal consistency checks (Jared Hance, PR 12191)
- Raise AttributeError also for non-refcounted types (Jukka Lehtosalo, PR 11940)
- Fix invalid unlikely() in certain rare branches (Jukka Lehtosalo, PR 11939)
- Skip no-op super calls to object.__init__() (Jukka Lehtosalo, PR 11938)
- Use latest pythoncapi_compat (97littleleaf11, PR 12188)
- Add helpful message to assert (Joshua Cannon, PR 12119)
- Documentation Updates
- Add documentations about Enum types (Nikita Sobolev, PR 11805)
- Update Enum documentation (Nikita Sobolev, PR 12238)
- Improve documentation of allow_redefinition (KotlinIsland, PR 11951)
- Fix intelligent indexing example (Chris Keefe, PR 11973)
- Explain generic Protocol[T1, T2, ...] shorthand (Matt Bogosian, PR 12047)
- Clarify that stub-only packages need to be installed (Gustav Gränsbo, PR 9958)
- Small documentation improvements for conditional overloads (Marc Mueller, PR 12283)
- Improved Error Messages
- Improve the "Argument must be a mapping" error message (Purna Chandra Mansingh, PR 12222)
- Coalesce Literals when printing unions (Marti Raudsepp, PR 12205)
- Suggest typing.Callable when using callable as type (Tuomas Siipola, PR 12204)
- Suggest typing.Any when using any as type (Tuomas Siipola, PR 12185)
- Add note about wrong error code in type: ignore (Jukka Lehtosalo, PR 12067)
- Add no-overload-impl error code (Brian Phillips, PR 11944)
- Display ellipsis when formatting variadic tuple[T, ...] (Marti Raudsepp, PR 11857)
- Deduplicate error codes for ignore-without-code (Marc Mueller, PR 12194)
- Tweak ignore-without-code error message (Marc Mueller, PR 12216)
- Mention common resolutions for build errors (Shantanu, PR 12154)
- Stubtest Improvements
- Ignore more dunder positional-only errors (Shantanu, PR 12294)
- Fix wrong assumption about relative path (Stanislav Levin, PR 12282)
- Catch more getattr errors (Shantanu, PR 12219)
- Error if module level dunder is missing, housekeeping (Shantanu, PR 12217)
- Ignore __main__ module (Shantanu, PR 12218)
- Error if a dunder method is missing from a stub (Alex Waygood, PR 12203)
- Error if a function is async at runtime but not in the stub (and vice versa) (Alex Waygood, PR 12212)
- Do not error if a stub is async, but runtime is not (Alex Waygood, PR 12234)
- Error if a class should be decorated with @final (Akuli, PR 12091)
- Use VERSIONS for submodules (Shantanu, PR 12083)
- Treat dicts as a subtype of typeddict (Shantanu, PR 12040)
- Ignore more exceptions in stubtest (Jelle Zijlstra, PR 11946)
- Other Notable Fixes and Improvements
- Fix non-default keyword-only argument positioning in stubgen (Štěpán Horáček, PR 12303)
- Remove orjson stubs from default list (Shantanu, PR 12264)
- Use __truediv__ for Python 2 with __future__ import (Nikita Sobolev, PR 11787)
- Fix Python 2 compatibility issue (Shantanu, PR 12244)
- Use type variable bound to infer constraints (Jukka Lehtosalo, PR 12230)
- Handle raise Exception(), None on Python 2.7 (Nikita Sobolev, PR 11786)
- Fix inference of protocol against overloaded function (Jukka Lehtosalo, PR 12227)
- Fix an issubclass failure for protocols with overloaded methods (Bas van Beek, PR 9904)
- Fix crashes in class scoped imports (PR 12199, PR 12023) (Shantanu)
- Fix use of TypeAlias from aliased imports (Shantanu, PR 12180)
- Delete open plugin (Shantanu, PR 9275)
- Read pyproject.toml with correct encoding on Windows (Dominic Davis-Foster, PR 12105)
- Fix issue with implicit type aliases in import cycles (but only for stubs) (Alex Waygood, PR 11915)
- Forbid extra ParamSpec arguments (Nikita Sobolev, PR 12024)
- Fix crash involving explicit any flag and Required (Mehdi Drissi, PR 12039)
- Fix join of Any against a union type (Jukka Lehtosalo, PR 12068)
- Simplify unions when erasing last known values (Jukka Lehtosalo, PR 12064)
- Fix crash with yield in comprehension (Alexandre Bouayad, PR 12048)
- Fix handling of NoReturn in union return types (Jannic Warken, PR 11996)
- Fix __init__ in dataclasses inheriting from Any (joey-laminar, PR 11966)
- Narrow NamedTuple to bool correctly when __bool__ is defined (Nikita Sobolev, PR 11822)
- Improve type of __attrs_attrs__ in attrs classes (Tin Tvrtković, PR 11794)
- Install dependencies needed for reports via pip install mypy[reports] (James Braza, PR 11777)
- Consider import * to be an explicit re-export (Shantanu, PR 11867)
- Fix --no-implicit-reexport inconsistency (Shantanu, PR 11707)
- Fix crash if "_" is in builtins (StefanM-TT, PR 11811)
- Fixes crash on subclassing Annotated without args (Nikita Sobolev, PR 11814)
- Typeshed Updates
- Typeshed is now modular and distributed as separate PyPI packages for everything except the standard library stubs. Please see git log for full list of typeshed changes.
-------------------------------------------------------------------
Sat Jan 22 18:36:56 UTC 2022 - Ben Greiner <code@bnavigator.de>
- Skip teststubtest because we use a pytest-xdist version which is
not allowed by upstream -- gh#python/mypy#11019
-------------------------------------------------------------------
Fri Jan 7 17:31:27 UTC 2022 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.931:
- Fixes to Regressions
- Fix mypyc binary wheel (Michael R. Crusoe, PR 11862)
- Revert to treating multi-line strings as a single value for exclude in TOML files (Matt Bogosian, PR 11828)
- Revert to treating exclude in .ini as a single value (Matt Bogosian, PR 11881)
- Fix __slots__ regression (Nikita Sobolev, PR 11824)
- Fix regression with __module__ and similar non-final Enum attributes (Nikita Sobolev, PR 11823)
- Fix regression when a contextmanager yields a generic function (Anthony Sottile, PR 11870)
- Fix __reduce__ regression (Shantanu, PR 11866)
- Fix NoReturn type aliases (Nikita Sobolev, PR 11912)
- Fix regression in None handling with --no-strict-optional (Nikita Sobolev, PR 11717)
- Fix crash related to generics (Nikita Sobolev, PR 11924)
- Restore removed builtin_type() plugin API method (Jukka Lehtosalo, PR 11932)
- Other Fixes
- Always allow the use of type[T] in stubs (Nikita Sobolev, PR 11863)
- Fix PEP 585 type aliases in stubs (Shantanu, PR 11918)
- Fix bug with literal types in stubtest (Nikita Sobolev, PR 11931)
-------------------------------------------------------------------
Fri Dec 31 19:58:41 UTC 2021 - Ben Greiner <code@bnavigator.de>
- Need typed_ast for all flavors in testing
- Skip failing tests on 32-bit: gh#python/mypy#11148
-------------------------------------------------------------------
Fri Dec 31 17:17:41 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- add missing g++ compiler for tests
-------------------------------------------------------------------
Fri Dec 31 16:40:37 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- add python-psutil as optional dependency.
-------------------------------------------------------------------
Fri Dec 31 11:48:26 UTC 2021 - Benjamin Greiner <code@bnavigator.de>
- Update requirements
- Reenable testsuite by including the typed_ast stubs manually
-------------------------------------------------------------------
Wed Dec 22 20:10:32 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.930:
- New Feature: Explicit Type Aliases (PEP 613)
- You can now explicitly mark an assignment as a type alias, by using typing.TypeAlias
- For more context, see the docs or PEP 613.
- New Feature: NotRequired in TypedDicts
- You can now define individual TypedDict items as non-required by using typing_extensions.NotRequired. Previously this could only be configured at TypedDict level (by using total=).
- You can also use typing_extensions.Required to mark an item as required in a non-total TypedDict.
- New Feature: ParamSpec (Experimental)
- Mypy now partially support ParamSpec, which was introduced in Python 3.10. This makes it possible to define type variables that range over the parameter specification of a callable type. In particular, it allows giving precise types for some decorators that change the return type of the decorated function.
- Miscellaneous New Features
- Define a GitHub Action that makes it easier to run mypy in GitHub CI workflows (Elvis Pranskevichus, PR 11320)
- Allow mypy to run self check on PyPy 3.8 beta (Ethan Smith, PR 11350)
- Check that enum values are unique (Nikita Sobolev, PR 11267)
- Make enum classess with values implicitly final (Nikita Sobolev, PR 11247)
- Make enum members implicitly final (Nikita Sobolev, PR 10852)
- Allow NamedTuple to be used as a type that accepts all named tuples, as an experimental extension (Nikita Sobolev, PR 11162)
- Allow booleans to be narrowed to literal types (Ethan Leba, PR 10389)
- Add slots=True support for @dataclass (Nikita Sobolev, PR 11483)
- Add slots=True support for @attr.s (Nikita Sobolev, PR 11489)
- Support the typing_extensions.OrderedDict alias (Nikita Sobolev, PR 11533)
- Usability and Documentation Improvements
- Add better NamedTuple error messages (Nikita Sobolev, PR 11127)
- Show all overloads in error message (Akuli, PR 9177)
- Fix error message for dataclasses.field with positional argument (Hiroshi Ogawa, PR 11180)
- Fix error message for f-string and str-bytes-safe (Nikita Sobolev, PR 11139)
- Add documentation for type: ignore (Tushar Sadhwani, PR 11358)
- Support --exclude more than once on command line (Nipunn Koorapati, PR 11329)
- Use list[int] instead of List[int] in documentation (PR 11377, PR 11450) (Nick Crews)
- Remove builtins. from error messages (97littleleaf11, PR 11522)
- Document explicit type aliases (Nikita Sobolev, PR 11800)
- Improve documentation of annotating generator functions (Alex Waygood, PR 11623)
- Improve error message for nested TypedDict (97littleleaf11, PR 11658)
- Exit gracefully on KeyboardInterrupt (Marc Mueller, PR 10725)
- Optimizations: This release includes some optimizations that make mypy a bit faster (in addition to mypyc performance improvements discussed below):
- Enable --fast-exit by default to speed up mypy (Jukka Lehtosalo, PR 11541)
- Only read the stdlib versions dictionary once per run (Jukka Lehtosalo, PR 11542)
- Optimize commonly used function (Jukka Lehtosalo, PR 11543)
- Minor optimization/cleanup (Jukka Lehtosalo, PR 11544)
- Reduce the number of executed local imports (Jukka Lehtosalo, PR 11545)
- Mypyc Fixes and Improvements
- Add missing type coercions (Jared Hance, PR 11176)
- Support --allow-redefinition (Jared Hance, PR 11175)
- Constant fold integer operations and string concatenation (Jukka Lehtosalo, PR 11194)
- Use optimized implementation for builtins.sum (Sara Sinback and 97littleleaf11, PR 10268)
- Move mypyc to console_scripts to fix running on Windows 10 (谭九鼎, PR 11494)
- Make min(x, y) faster(Chetan Khanna and 97littleleaf11, PR 10265)
- Make max(x, y) faster (97littleleaf11, PR 11530)
- Speed up reference counting operations by inlining them in commonly executed blocks (Jukka Lehtosalo, PR 11540)
- Add support for attrs classes (Chad Dombrova, PR 11328)
- Port mypyc to Python 3.11 (Victor Stinner, PR 11652)
- Reduce the amount of debug information included in compiled extension modules (Nehal J Wani, PR 11526)
- Other Notable Fixes and Improvements
- Fix semantic analysis of assignment expressions (Shantanu, PR 11153)
- Fixes mypy crash on protocol with contravariant variable (Nikita Sobolev, PR 11135)
- Warn about unused ignores when not all specified error codes are used (Hiroshi Ogawa, PR 11178)
- Improve type narrowing for walrus operator in conditional statements (Shantanu, PR 11202)
- Fix literal type compatibility checking special case (Nikita Sobolev, PR 11236)
- Rename API method builtin_type to named_type (97littleleaf11, PR 11224)
- Fix narrowing information not propagated in assignment and boolean expressions (Ran Benita, PR 11207)
- Fix narrowing of a nested union of TypedDicts (Ran Benita, PR 11204)
- Fix case mismatching modules during namespace package search (Nipunn Koorapati, PR 11261)
- Disallow invalid identifiers from getting implicit bazel __init__.py (Nipunn Koorapati, PR 11268)
- Don’t type check lambdas nested in unchecked functions (Nikita Sobolev, PR 11213)
- Update None.__bool__ to return Literal[False] (Nikita Sobolev, PR 11290)
- Relax type checking of % formatting when the right operand is an iterable (97littleleaf11, PR 11319)
- Fix crash with namespace packages when generating html reports (Nikita Sobolev, PR 11338)
- Allow slice syntax in Annotated types (Zac Hatfield-Dodds, PR 11345)
- Show warning if self / cls argument is missing (Nikita Sobolev, PR 11317)
- Improve subtype checking of TypeGuard types (Nikita Sobolev, PR 11314)
- Fix type narrowing for overlaping runtime types (Nikita Sobolev, PR 11273)
- Do not use TypeGuard context for lambda (Nikita Sobolev, PR 11417)
- Check reachability in module bodies (Nikita Sobolev, PR 11361)
- Check that __new__ in a metaclass returns a subtype of type (Nikita Sobolev, PR 11420)
- Improve support of contextlib.asynccontextmanager (Barnaby Shearer, PR 11352)
- Discard deprecated builtin_type (97littleleaf11, PR 11343)
- Don't look in user site packages when using a virtual env (Dimitri Merejkowsky, PR 11444)
- Update stubgen to preserve string literals in annotations (Imad Eddine Rezgui, PR 11292)
- Fix issue with exporting names in the presence of __getattr__ (Shantanu, PR 11411)
- Reject duplicate bases when defining TypedDict (97littleleaf11, PR 11485)
- Fix type inference for index expression with a bounded TypeVar (Ilya Labun, PR 11434)
- Fix get_dynamic_class_hook in some scenarios (Jade Lin, PR 10904)
- Check print >> properly (Nikita Sobolev, PR 11576)
- Correctly handle cls in protocol classmethod (Ilia Novoselov, PR 11119)
- Use current Python version, rather than hardcoding 3.6, in stubgen (Shantanu, PR 10907)
- Don't use ModuleType.__getattr__ if we know module symbols (Jukka Lehtosalo, PR 11597)
- Fix strict equality when using the latest typeshed (Jukka Lehtosalo, PR 11599)
- Make sure ClassVar does not contain type variables (Nikita Sobolev, PR 11585)
- Allow overriding attributes with methods (Nikita Sobolev, PR 11561)
- Don’t generate an error for PEP 593 Annotated with a string literal second argument (Seth Yastrov, PR 10777)
- Install types to the correct environment (Konstantin Weddige, PR 11457)
- Support decorators in additional contexts (Nikita Sobolev, PR 11150)
- Fix crash involving unreachable binary operations (Shantanu, PR 11680)
- Fix None assignments with mypy daemon cache (Christian Bundy, PR 11574)
- Handle OSError when accessing the mtime of a mypy cache file (Zac Hatfield-Dodds, PR 11718)
- Special case some special Enum properties to be non-final (Nikita Sobolev, PR 11713)
- Fix crash involving undefined cyclic import * (Shantanu, PR 11681)
- Remove incorrect assumption about file system case sensitivity (Shantanu, PR 11708)
- Fix compatibility of bool and Literal[True, False] (Nikita Sobolev, PR 11709)
- Allow subclassing enums with annotations and no values (Nikita Sobolev, PR 11579)
-------------------------------------------------------------------
Wed Dec 22 11:34:33 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.921:
- Bug Fixes Included in This Release:
- Fix regression in PathLike (Shantanu, PR 11785)
- Allow calling a function with name _ (Jukka Lehtosalo, PR 11810)
- Fix signature in curses and corresponding dmypy bug (Shantanu, PR 11785)
-------------------------------------------------------------------
Thu Dec 16 08:04:39 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Update to version 0.920:
- Making a Variable Optional in an Else Block
- Now mypy alllows more general conditionally defined variables with optional types. Previously mypy allowed this only if a None assignment happened first. Now this is also supported. Implemented by Michael J. Sullivan in PR 11002.
- Type Checking __slots__ Assignment
- For classes that define the special __slots__ attribute, mypy will now report an error on assigning to attributes that are not found in the slots definitions (this matches runtime semantics).
- Note that this feature does not work for dynamically computed slots. Implemented by Nikita Sobolev in PR 10864.
- Partial Python 3.10 Support
- We now ship binary wheels for Python 3.10 and mypy supports the new Python 3.10 union type syntax.
- Some new features, including the match statement, ParamSpec and TypeAlias are not supported yet.
- Python 3.5 Is No Longer Supported
- Python 3.5 reached its end of life more than a year ago. Its support was deprecated in mypy 0.910 and it is no longer supported in mypy 0.920.
- Efficient String and Bytes Formatting in Mypyc
- Most string and bytes formatting methods now use fast C-level logic when compiled with mypyc. This includes % formatting, the format() method, and f-strings. This was implemented by 97littleleaf11 as part of a Google Summer of Code project.
- Work Towards singledispatch Support
- The signature of the initial function variant handles the generic case and describes the external signature of the singledispatch function.
- This was implemented Pranav Rajpal as part of a Google Summer of Code project.
- Stubgen Improvements
- Add support for yield statements in stubgen (Sebastian Rittau, PR 10745)
- Handle commas in namedtuple field definition in stubgen (Vanessa Ung, PR 10828)
- Other Notable Fixes and Improvements
- Allow plugin signature hooks to return FunctionLike (to support overloads) (pranavrajpal, PR 10717)
- Narrow type with type variable when the upper bound is a subtype of current type (ethframe, PR 10658)
- Make --cache-fine-grained imply --local-partial-types (Michael J. Sullivan, PR 10737)
- Support new union syntax in stubs independent of target Python version and in runtime context (PR 10770, PR 10771) (Jukka Lehtosalo)
- Support new union type syntax with isinstance() (Jukka Lehtosalo, PR 10775)
- Better message if method is incompatible with base class (Anmol Takiar, PR 10572)
- Allow redefinition of underscore functions (named '_') (pranavrajpal, PR 10811)
- Properly track positional-only arguments for unannotated functions (Michael J. Sullivan, PR 10802)
- Fixes to type checking %c string and bytes interpolation (97littleleaf11, PR 10869)
- Use better error message for %c interpolation (97littleleaf11, PR 10875)
- Skip overlapping overload checks in ignored files (Shantanu, PR 10922)
- Fix ad hoc instance intersection logic (Christoph Tyralla, PR 9909)
- Support tuple multiplication with literal integers (hatal175, PR 10361)
- Fix recursion issue with nested instances and unions (Peilonrayz, PR 9663)
- Fix caching behavior of PEP561-installed namespace packages (Michael J. Sullivan, PR 10937)
- Add __dataclass_fields__ and __attrs_attrs__ to dataclasses (Timofey Kukushkin, PR 8578)
- Fix argument checking on empty dict with double stars (Momoko Hattori, PR 9629)
- Fix some type-guard-related crashes (Shantanu, PR 11061)
- Reject raise Err if Err can’t be called without arguments (Nikita Sobolev, PR 11125)
- Fix TypedDict crash with function definition (Nikita Sobolev, PR 11126)
- Report attribute access errors for type variable bound to a union (Christoph Tyralla, PR 11140)
- Fix crash on dataclasses.field(unpack) (Nikita Sobolev, PR 11137)
- Fix crash related to ParamSpec in mypy daemon (Jukka Lehtosalo, PR 11567)
- Properly type check *CustomType and CustomType function arguments (Nikita Sobolev, PR 11151)
- Fix crash with overload and callable object decorators (Shantanu, PR 11630)
- Fix crash involving explicit reexport, import cycle, and a wildcard (Shantanu, PR 11632)
- Mypyc Features, Fixes, and Performace Improvements
- Fix class-based named tuples (Jukka Lehtosalo, PR 10746)
- Add a special case for len() of a string value (97littleleaf11, PR 10710)
- Reject instance attribute access through class object (Jukka Lehtosalo, PR 10798)
- Speed up the construction of list objects (97littleleaf11, PR 10807)
- Add bytes primitive type (97littleleaf11, PR 10881)
- Add bytearray support (97littleleaf11, PR 10891)
- Optimize construction via list() and dict() (Richard Si, PR 10918)
- Speed up bytes join() method (jhance, PR 10929)
- Speed up len(bytes) (97littleleaf11, PR 10936)
- Speed up bytes indexing and slicing (PR 10966, PR 10950) (97littleleaf11)
- Speed up bytes.decode() and str.encode() (PR 10974, PR 10951) (97littleleaf11)
- Speed up bytes equality checks (jhance, PR 10928)
- Documentation Improvements
- Add docs about exhaustive literal and enum checks (Nikita Sobolev, PR 10860)
- Add ‘or’ regular expression example to --exclude documentation (Niklas Gustafsson, PR 10903)
- Document per-module follow_imports more explicitly (Shantanu, PR 10845)
- Add docs for the TypeGuard type (Nikita Sobolev, PR 10758)
- Update type narrowing section in common issues (Nikita Sobolev, PR 11014)
- Document how --no-implicit-reexport handles from X import Y as Z (Max Marrone, PR 11083)
- Document strict config file option (Anders Kaseorg, PR 11132)
- Add better type narrowing documentation (Nikita Sobolev, PR 11088)
- Add documentation about := and type guards (Nikita Sobolev, PR 11161)
-------------------------------------------------------------------
Tue Nov 2 19:49:00 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- disable the tests to fix the build temporarily
-------------------------------------------------------------------
Sat Jul 10 14:47:09 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- Remove obsolete build (prep) instructions: typeshed has been removed from the archive.
-------------------------------------------------------------------
Sun Jul 4 20:06:55 UTC 2021 - Sebastian Wagner <sebix+novell.com@sebix.at>
- update to version 0.910:
- Mypy 0.900 added --install-types to install missing stub packages. We received feedback that this wasn’t a good fit for all use cases, since it asks for interactive confirmation from the user, and it requires another mypy invocation to actually perform type checking.
- This release adds the new option --non-interactive that can be used with --install-types to install suggested stub packages without asking for confirmation. This can be useful in Continuous Integration jobs. The option causes mypy to both install stub packages and perform type checking within a single invocation. When not using --non-interactive, you’d have to run mypy again to get up-to-date results with the installed stubs.
- This option provides a new way to migrate existing mypy runner scripts after updating to mypy 0.9xx: just add the --install-types --non-interactive options to your mypy command line.
- Note that --install-types currently always installs the latest stubs for all supported packages. If you want reproducible results from your builds, we recommend explicitly pinning stub package versions in your requirements.txt file, for example.
- Python 3.5 Deprecation
- Running mypy on Python 3.5 is now deprecated. A future mypy release will drop Python 3.5 support. We haven’t decided when this will happen, but this might happen in the next feature release after 0.910.
- Stubgen Improvements
- Don't annotate unknown argument and return types (Sebastian Rittau, PR 10626)
- Never generate a variable initializer (Sebastian Rittau, PR 10623)
- Use NamedTuple class syntax (Sebastian Rittau, PR 10625)
- Use T | None (PEP 604) instead of Optional[T] (Sebastian Rittau, PR 10624)
- Other Fixes and Improvements
- Fix some crashes from faulty casts (Shantanu, PR 10560)
- Update docs for deferral of PEP 563 to 3.11 (Smart, PR 10655)
- Don't suggest to install stubs for packages with py.typed files (Sebastian Rittau, PR 10652)
- Correct the type package name of pyopenssl ( Sebastian Rittau, PR 10656)
- Improve error reporting when --install-types has no cache (PR 10667)
- Suggest types-setuptools for pkg_resources (Sebastian Rittau, PR 10681)
- Fix crash with assignment to variable guarded with TypeGuard (PR 10683)
- Don't ask to install a stub package if stubs are installed (PR 10670)
- Fix crash when inferring multiple assignment with overloaded function (PR 10689)
- update to version 0.900:
- Third-party Library Stubs in Stub Packages (Breaking Change)