ChangeLog 51.6 KB
Newer Older
David Douard's avatar
David Douard committed
1
2
Change log for the astroid package (used to be astng)
=====================================================
Claudiu Popa's avatar
Claudiu Popa committed
3

4
--
5
6
7
8
   * Added brain tips for random.sample

     Part of PyCQA/pylint#811

9
10
11
12
   * Add brain tip for `issubclass` builtin

     Close #101.

13
14
   * Fix submodule imports from six

Claudiu Popa's avatar
Claudiu Popa committed
15
     Close PyCQA/pylint#1640
16

17
18
   * Fix missing __module__ and __qualname__ from class definition locals

Claudiu Popa's avatar
Claudiu Popa committed
19
	 Close PYCQA/pylint#1753
20

21
22
23
24
   * Fix a crash when __annotations__ access a parent's __init__ that does not have arguments

     Close #473

Claudiu Popa's avatar
Claudiu Popa committed
25
   * Fix multiple objects sharing the same InferenceContext.path causing uninferable results
Bryce Guinta's avatar
Bryce Guinta committed
26
27
28

     Close #483

Claudiu Popa's avatar
Claudiu Popa committed
29
   * Fix improper modification of col_offset, lineno upon inference of builtin functions
Bryce Guinta's avatar
Bryce Guinta committed
30
31
32

     Close PyCQA/pylint#1839

33
34
35
36
   * Subprocess.Popen brain now knows of the args member

     Close PyCQA/pylint#1860

37
38
39
40
   * add move_to_end method to collections.OrderedDict brain

     Close PyCQA/pylint#1872

Ioana Tagirta's avatar
Ioana Tagirta committed
41
42
   * Include new hashlib classes added in python 3.6

Bryce Guinta's avatar
Bryce Guinta committed
43
44
45
46
   * Fix RecursionError for augmented assign

     Close #437, #447, #313, PyCQA/pylint#1642, PyCQA/pylint#1805, PyCQA/pylint#1854, PyCQA/pylint#1452

47
48
   * Add missing attrs special attribute

Claudiu Popa's avatar
Claudiu Popa committed
49
	 Close PyCQA/pylint#1884
50

Claudiu Popa's avatar
Claudiu Popa committed
51
   * Inference now understands the 'isinstance' builtin
52
53
54

     Close #98

Claudiu Popa's avatar
Claudiu Popa committed
55
56
   * Stop duplicate nodes with the same key values
     from appearing in dictionaries from dictionary unpacking.
57
58
59

     Close PyCQA/pylint#1843

Claudiu Popa's avatar
Claudiu Popa committed
60
   * Fix ``contextlib.contextmanager`` inference for nested context managers
61

Claudiu Popa's avatar
Claudiu Popa committed
62
     Close #1699
63

Claudiu Popa's avatar
Claudiu Popa committed
64
   * Implement inference for len builtin
65

Claudiu Popa's avatar
Claudiu Popa committed
66
     Close #112
67

68

Claudiu Popa's avatar
Claudiu Popa committed
69
70
2017-12-15 -- 1.6.0

71
72
73
74
   * When verifying duplicates classes in MRO, ignore on-the-fly generated classes

     Close PyCQA/pylint#1706

75
76
77
78
   * Add brain tip for attrs library to prevent unsupported-assignment-operation false positives

	 Close PYCQA/pylint#1698

79
80
81
82
   * file_stream was removed, since it was deprecated for three releases

     Instead one should use the .stream() method.

83
84
   * Vast improvements to numpy support

Claudiu Popa's avatar
Claudiu Popa committed
85
86
87
88
   * Add brain tips for curses

     Close PyCQA/pylint#1703

Claudiu Popa's avatar
Claudiu Popa committed
89
90
91
92
   * Add brain tips for UUID.int

     Close PyCQA/pylint#961

93
94
95
96
   * The result of using object.__new__ as class decorator is correctly inferred as instance

     Close #172

97
   * Enums created with functional syntax are now iterable
98

99
100
   * Enums created with functional syntax are now subscriptable

101
102
103
104
105
106
107
108
   * Don't crash when getting the string representation of BadUnaryOperationMessage

     In some cases, when the operand does not have a .name attribute,
     getting the string representation of a BadUnaryOperationMessage leads
     to a crash.

     Close PyCQA/pylint#1563

109
110
111
112
113
114
115
116
117
118
   * Don't raise DuplicateBaseError when classes at different locations are used

     For instance, one can implement a namedtuple base class, which gets reused
     on a class with the same name later on in the file. Until now, we considered
     these two classes as being the same, because they shared the name, but in fact
     they are different, being created at different locations and through different
     means.

     Close PyCQA/pylint#1458

119
120
121
122
    * The func form of namedtuples with keywords is now understood

      Close PyCQA/pylint#1530

123
124
125
126
    * Dunder class at method level is now inferred as the class of the method

      Close PyCQA/pylint#1328

Bryce Guinta's avatar
Bryce Guinta committed
127
128
129
130
131
    * Stop most inference tip overwrites from happening by using
		predicates on existing inference_tip transforms.

      Close #472

Claudiu Popa's avatar
Claudiu Popa committed
132
2017-06-03 -- 1.5.3
133
134
135
136
137
138
139
140
141
142

    * enum34 dependency is forced to be at least version 1.1.3. Fixes spurious
    bug related to enum classes being falsy in boolean context, which caused
    _Inconsistent Hierarchy_ `RuntimeError` in `singledispatch` module.

    See links below for details:
    - http://bugs.python.org/issue26748
    - https://bitbucket.org/ambv/singledispatch/issues/8/inconsistent-hierarchy-with-enum
    - https://bitbucket.org/stoneleaf/enum34/commits/da50803651ab644e6fce66ebc85562f1117c344b

143
144
    * Do not raise an exception when uninferable value is unpacked in ``with`` statement.

145
146
147
    * Lock objects from ``threading`` module are now correctly recognised
      as context managers.

Claudiu Popa's avatar
Claudiu Popa committed
148
2017-04-17 -- 1.5.2
149
150
151

   * Basic support for the class form of typing.NamedTuple

152
153
   * mro() can be computed for classes with old style classes in the hierarchy

154

Claudiu Popa's avatar
Claudiu Popa committed
155
156
2017-04-13 -- 1.5.0

157
158
159
160
161
    * Arguments node gained a new attribute, ``kwonlyargs_annotations``

      This new attribute holds the annotations for the keyword-only
      arguments.
      
162
163
    * `namedtuple` inference now understands `rename` keyword argument

164
165
166
167
168
    * Classes can now know their definition-time arguments.

      Classes can support keyword arguments, which are passed when
      a class is constructed using ``__new__``.

Claudiu Popa's avatar
Claudiu Popa committed
169
170
    * Add support for inferring typing.NamedTuple.

171
172
    * ClassDef now supports __getitem__ inference through the metaclass.

173
174
    * getitem() method accepts nodes now, instead of Python objects.

175
176
    * Add support for explicit namespace packages, created with pkg_resources.

177
178
    * Add brain tips for _io.TextIOWrapper's buffer and raw attributes.

179
180
181
182
183
    * Add `returns` into the proper order in FunctionDef._astroid_fields

      The order is important, since it determines the last child,
      which in turn determines the last line number of a scoped node.

184
185
    * Add brain tips for functools.lru_cache.

186
187
    * New function, astroid.extract_node, exported out from astroid.test_utils.

188
189
190
191
192
193
194
    * Stop saving assignment locals in ExceptHandlers, when the context is a store.

      This fixes a tripping case, where the RHS of a ExceptHandler can be redefined
      by the LHS, leading to a local save. For instance, ``except KeyError, exceptions.IndexError``
      could result in a local save for IndexError as KeyError, resulting in potential unexpected
      inferences. Since we don't lose a lot, this syntax gets prohibited.

195
196
    * Fix a crash which occurred when the class of a namedtuple could not be inferred.

197
198
199
200
201
202
203
204
205
206
207
    * Add support for implicit namespace packages (PEP 420)

      This change involves a couple of modifications. First, we're relying on a
      spec finder protocol, inspired by importlib's ModuleSpec, for finding where
      a file or package is, using importlib's PathFinder as well, which enable
      us to discover namespace packages as well.
      This discovery is the center piece of the namespace package support,
      the other part being the construction of a dummy Module node whenever
      a namespace package root directory is requested during astroid's import
      references.

208
209
210
211
212
213
214
215
    * Introduce a special attributes model

      Through this model, astroid starts knowing special attributes of certain Python objects,
      such as functions, classes, super objects and so on. This was previously possible before,
      but now the lookup and the attributes themselves are separated into a new module,
      objectmodel.py, which describes, in a more comprehensive way, the data model of each
      object.

216
217
218
219
220
221
222
223
224
225
226
    * Exceptions have their own object model

      Some of exceptions's attributes, such as .args and .message,
      can't be inferred correctly since they are descriptors that get
      transformed into the proper objects at runtime. This can cause issues
      with the static analysis, since they are inferred as different than
      what's expected. Now when we're creating instances of exceptions,
      we're inferring a special object that knows how to transform those
      runtime attributes into the proper objects via a custom object model.
      Closes issue #81

227
228
229
230
    * dict.values, dict.keys and dict.items are properly
      inferred to their corresponding type, which also
      includes the proper containers for Python 3.

231
232
233
    * Fix a crash which occurred when a method had a same name as a builtin object,
      decorated at the same time by that builtin object ( a property for instance)

234
235
236
237
238
239
    * The inference can handle the case where the attribute is accessed through a subclass
      of a base class and the attribute is defined at the base class's level,
      by taking in consideration a redefinition in the subclass.

      This should fix https://github.com/PyCQA/pylint/issues/432

240
241
    * Calling lambda methods (defined at class level) can be understood.

242
243
244
245
246
    * Don't take in consideration invalid assignments, especially when __slots__
      declaration forbids them.
      
      Close issue #332

247
    * Functional form of enums support accessing values through __call__.
248

249
250
    * Brain tips for the ssl library.

251
252
    * decoratornames() does not leak InferenceError anymore.

253
254
255
256
257
258
259
260
261
262
263
264
265
    * wildcard_imported_names() got replaced by _public_names()

      Our understanding of wildcard imports through __all__ was
      half baked to say at least, since we couldn't account for
      modifications of the list, which results in tons of false positives.
      Instead, we replaced it with _public_names(), a method which returns
      all the names that are publicly available in a module, that is that
      don't start with an underscore, even though this means that there
      is a possibility for other names to be leaked out even though
      they are not present in the __all__ variable.

      The method is private in 1.4.X.

266
267
268
    * unpack_infer raises InferenceError if it can't operate
      with the given sequences of nodes.

269
270
    * Support accessing properties with super().

271
272
273
274
275
276
277
278
279
280
281
282
    * Enforce strong updates per frames.

      When looking up a name in a scope, Scope.lookup will return
      only the values which will be reachable after execution, as seen
      in the following code:
      
           a = 1
           a = 2

      In this case it doesn't make sense to return two values, but
      only the last one.

283
284
285
286
287
    * Add support for inference on threading.Lock

      As a matter of fact, astroid can infer on threading.RLock,
      threading.Semaphore, but can't do it on threading.Lock (because it comes
      from an extension module).
288

Claudiu Popa's avatar
Claudiu Popa committed
289
    * pkg_resources brain tips are a bit more specific,
Jakub Wilk's avatar
Jakub Wilk committed
290
      by specifying proper returns.
Claudiu Popa's avatar
Claudiu Popa committed
291

292
293
294
295
296
297
298
    * The slots() method conflates all the slots from the ancestors
      into a list of current and parent slots.

      We're doing this because this is the right semantics of slots,
      they get inherited, as long as each parent defines a __slots__
      entry.

299
300
301
302
303
304
305
    * Some nodes got a new attribute, 'ctx', which tells in which context
      the said node was used.

      The possible values for the contexts are `Load` ('a'), `Del`
      ('del a'), `Store` ('a = 4') and the nodes that got the new
      attribute are Starred, Subscript, List and Tuple. Closes issue #267.

306
307
308
    * relative_to_absolute_name or methods calling it will now raise
      TooManyLevelsError when a relative import was trying to
      access something beyond the top-level package.     
309

310
311
312
    * AstroidBuildingException is now AstroidBuildingError. The first
      name will exist until astroid 2.0.

313
314
315
316
317
318
    * Add two new exceptions, AstroidImportError and AstroidSyntaxError.
      They are subclasses of AstroidBuildingException and are raised when
      a module can't be imported from various reasons.
      Also do_import_module lets the errors to bubble up without converting
      them to InferenceError. This particular conversion happens only
      during the inference.
319

320
321
    * Revert to using printf-style formatting in as_string, in order
      to avoid a potential problem with encodings when using .format.
322
      Closes issue #273. Patch by notsqrt.
323

324
325
326
327
328
329
    * assigned_stmts methods have the same signature from now on.
      
      They used to have different signatures and each one made
      assumptions about what could be passed to other implementations,
      leading to various possible crashes when one or more arguments
      weren't given. Closes issue #277.
330
331
332

    * Fix metaclass detection, when multiple keyword arguments
      are used in class definition.
333

334
335
    * Add support for annotated variable assignments (PEP 526)

336
337
338
    * Starred expressions are now inferred correctly for tuple,
      list, set, and dictionary literals.

339
340
341
    * Support for asynchronous comprehensions introduced in Python 3.6.

      Fixes #399. See PEP530 for details.
342
343
344

2015-11-29 -- 1.4.1

345
346
347
348
349
350
351
352
353
354
355
356
    * Add support for handling Uninferable nodes when calling as_string

      Some object, for instance List or Tuple can have, after inference,
      Uninferable as their elements, happening when their components
      weren't couldn't be inferred properly. This means that as_string
      needs to cope with expecting Uninferable nodes part of the other
      nodes coming for a string transformation. The patch adds a visit
      method in AsString and ``accept`` on Yes / Uninferable nodes.
      Closes issue #270.


2015-11-29 -- 1.4.0 
357
358
359

    * Class.getattr('__mro__') returns the actual MRO. Closes issue #128.

Florian Bruhin's avatar
Florian Bruhin committed
360
361
362
    * The logilab-common dependency is not needed anymore as the needed code
      was integrated into astroid.

363
364
365
    * Generated enum member stubs now support IntEnum and multiple
      base classes.

366
367
368
369
370
    * astroid.builder.AstroidBuilder.string_build and
      astroid.builder.AstroidBuilder.file_build are now raising
      AstroidBuildingException when the parsing of the string raises
      a SyntaxError.

371
372
373
    * Add brain tips for multiprocessing.Manager and
      multiprocessing.managers.SyncManager.

374
375
376
377
378
379
    * Add some fixes which enhances the Jython support.
      The fix mostly includes updates to modutils, which is
      modified in order to properly lookup paths from live objects,
      which ends in $py.class, not pyc as for Python 2,       
      Closes issue #83.

380
381
382
383
    * The Generator objects inferred with `infer_call_result`
      from functions have as parent the function from which they
      are returned.

384
385
386
387
388
    * Add brain tips for multiprocessing post Python 3.4+,
      where the module level functions are retrieved with getattr
      from a context object, leading to many no-member errors
      in Pylint.

389
390
391
392
    * Understand partially the 3-argument form of `type`.
      The only change is that astroid understands members
      passed in as dictionaries as the third argument.

393
394
395
396
397
    * .slots() will return an empty list for classes with empty slots.
      Previously it returned None, which is the same value for
      classes without slots at all. This was changed in order
      to better reflect what's actually happening.

398
399
400
401
402
403
404
    * Improve the inference of Getattr nodes when dealing with
      abstract properties from the abc module.

      In astroid.bases.Instance._wrap_attr we had a detection
      code for properties, which basically inferred whatever
      a property returned, passing the results up the stack,
      to the igetattr() method. It handled only the builtin property
405
406
      but the new patch also handles a couple of other properties,
      such as abc.abstractproperty.
407

408
409
410
411
412
413
414
    * UnboundMethod.getattr calls the getattr of its _proxied object
      and doesn't call super(...) anymore.

      It previously crashed, since the first ancestor in its mro was
      bases.Proxy and bases.Proxy doesn't implement the .getattr method.
      Closes issue #91.

415
416
417
418
419
420
421
    * Don't hard fail when calling .mro() on a class which has 
      combined both newstyle and old style classes. The class
      in question is actually newstyle (and the __mro__ can be
      retrieved using Python).

      .mro() fallbacks to using .ancestors() in that case.

422
423
424
425
426
427
428
429
430
431
    * Class.local_attr and Class.local_attr_ancestors uses internally
      a mro lookup, using .mro() method, if they can.

      That means for newstyle classes, when trying to lookup a member
      using one of these functions, the first one according to the
      mro will be returned. This reflects nicely the reality,
      but it can have as a drawback the fact that it is a behaviour
      change (the previous behaviour was incorrect though). Also,
      having bases which can return multiple values when inferred
      will not work with the new approach, because .mro() only
432
433
434
435
      retrieves the first value inferred from a base.

    * Expose a implicit_metaclass() method in Class. This will return
      a builtins.type instance for newstyle classes. 
436

437
438
439
440
441
442
443
    * Add two new exceptions for handling MRO error cases. DuplicateBasesError
      is emitted when duplicate bases are found in a class,
      InconsistentMroError is raised when the method resolution is determined
      to be inconsistent. They share a common class, MroError, which
      is a subclass of ResolveError, meaning that this change is backwards
      compatible.

444
445
    * Classes aren't marked as interfaces anymore, in the `type` attribute.

446
447
448
449
450
451
452
    * Class.has_dynamic_getattr doesn't return True for special methods
      which aren't implemented in pure Python, as it is the case for extension modules.

      Since most likely the methods were coming from a live object, this implies
      that all of them will have __getattr__ and __getattribute__ present and it
      is wrong to consider that those methods were actually implemented.

453
454
455
456
457
458
    * Add basic support for understanding context managers.

      Currently, there's no way to understand whatever __enter__ returns in a
      context manager and what it is binded using the ``as`` keyword. With these changes,
      we can understand ``bar`` in ``with foo() as bar``, which will be the result of __enter__.

459
460
    * Add a new type of node, called *inference objects*. Inference objects are similar with
      AST nodes, but they can be obtained only after inference, so they can't be found
461
      inside the original AST tree. Their purpose is to handle at astroid level
462
463
464
465
466
467
      some operations which can't be handled when using brain transforms.
      For instance, the first object added is FrozenSet, which can be manipulated
      at astroid's level (inferred, itered etc). Code such as this 'frozenset((1,2))'
      will not return an Instance of frozenset, without having access to its
      content, but a new objects.FrozenSet, which can be used just as a nodes.Set.

468
469
470
471
472
473
474
475
476
477
    * Add a new *inference object* called Super, which also adds support for understanding
      super calls. astroid understands the zero-argument form of super, specific to
      Python 3, where the interpreter fills itself the arguments of the call. Also, we
      are understanding the 2-argument form of super, both for bounded lookups
      (super(X, instance)) as well as for unbounded lookups (super(X, Y)),
      having as well support for validating that the object-or-type is a subtype
      of the first argument. The unbounded form of super (one argument) is not
      understood, since it's useless in practice and should be removed from
      Python's specification. Closes issue #89.

478
479
480
    * Add inference support for getattr builtin. Now getattr builtins are
      properly understood. Closes issue #103.

481
482
    * Add inference support for hasattr builtin. Closes issue #102.

483
484
    * Add 'assert_equals' method in nose.tools's brain plugin.

485
486
    * Don't leak StopIteration when inferring invalid UnaryOps (+[], +None etc.).

487
488
489
490
491
492
    * Improve the inference of UnaryOperands.

      When inferring unary operands, astroid looks up the return value
      of __pos__, __neg__ and __invert__ to determine the inferred value
      of ``~node``, ``+node`` or ``-node``.

493
494
495
496
    * Improve the inference of six.moves, especially when using `from ... import ...`
      syntax. Also, we added a new fail import hook for six.moves, which fixes the
      import-error false positive from pylint. Closes issue #107.

497
498
499
500
501
502
503
504
505
506
507
    * Make the first steps towards detecting type errors for unary and binary
      operations.

      In exceptions, one object was added for holding information about a possible
      UnaryOp TypeError, object called `UnaryOperationError`. Even though the name
      suggests it's an exception, it's actually not one. When inferring UnaryOps,
      we use this special object to mark a possible TypeError,
      object which can be interpreted by pylint in order to emit a new warning.
      We are also exposing a new method for UnaryOps, called `type_errors`,
      which returns a list of UnaryOperationsError.

508
509
510
511
512
513
514
515
516
    * A new method was added to the AST nodes, 'bool_value'. It is used to deduce
      the value of a node when used in a boolean context, which is useful
      for both inference, as well as for data flow analysis, where we are interested
      in what branches will be followed when the program will be executed.
      `bool_value` returns True, False or YES, if the node's boolean value can't
      be deduced. The method is used when inferring the unary operand `not`.
      Thus, `not something` will result in calling `something.bool_value` and
      negating the result, if it is a boolean.

517
518
    * Add inference support for boolean operations (`and` and `not`).

519
520
    * Add inference support for the builtin `callable`.

521
522
523
524
    * astroid.inspector was moved to pylint.pyreverse, since
      it is the only known client of this module. No other change
      was made to the exported API.

525
526
527
    * astroid.utils.ASTWalker and astroid.utils.LocalsVisitor
      were moved to pylint.pyreverse.utils.

528
529
    * Add inference support for the builtin `bool`.

530
531
    * Add `igetattr` method to scoped_nodes.Function.

532
533
534
    * Add support for Python 3.5's MatMul operation: see PEP 465 for more
      details.

535
536
537
538
    * NotImplemented is detected properly now as being part of the
      builtins module. Previously trying to infer the Name(NotImplemented)
      returned an YES object.

539
540
541
542
543
    * Add astroid.helpers, a module of various useful utilities which don't
      belong yet into other components. Added *object_type*, a function
      which can be used to obtain the type of almost any astroid object,
      similar to how the builtin *type* works.

544
545
546
547
548
    * Understand the one-argument form of the builtin *type*.

      This uses the recently added *astroid.helpers.object_type* in order to
      retrieve the Python type of the first argument of the call.

549
550
551
    * Add helpers.is_supertype and helpers.is_subtype, two functions for
      checking if an object is a super/sub type of another.

552
553
554
    * Improve the inference of binary arithmetic operations (normal
      and augmented).

555
556
557
558
559
560
561
    * Add support for retrieving TypeErrors for binary arithmetic operations.

      The change is similar to what was added for UnaryOps: a new method
      called *type_errors* for both AugAssign and BinOp, which can be used
      to retrieve type errors occurred during inference. Also, a new
      exception object was added, BinaryOperationError.

562
563
564
    * Lambdas found at class level, which have a `self` argument, are considered
      BoundMethods when accessing them from instances of their class.

565
566
567
    * Add support for multiplication of tuples and lists with instances
      which provides an __index__ returning-int method.

568
569
570
    * Add support for indexing containers with instances which provides
      an __index__ returning-int method.

571
572
573
    * Star unpacking in assignments returns properly a list,
      not the individual components. Closes issue #138.

574
575
    * Add annotation support for function.as_string(). Closes issue #37.

576
577
    * Add support for indexing bytes on Python 3.

578
579
580
    * Add support for inferring subscript on instances, which will 
      use __getitem__. Closes issue #124.

581
582
    * Add support for pkg_resources.declare_namespaces.

583
584
585
    * Move pyreverse specific modules and functionality back into pyreverse
      (astroid.manager.Project, astroid.manager.Manager.project_from_files).

586
587
    * Understand metaclasses added with six.add_metaclass decorator. Closes issue #129.

588
589
590
591
    * Add a new convenience API, `astroid.parse`, which can be used to retrieve
      an astroid AST from a source code string, similar to how ast.parse can be
      used to obtain a Python AST from a source string. This is the test_utils.build_module
      promoted to a public API.
592
593
594
595
596
597

    * do_import_module passes the proper relative_only flag if the level is higher
      than 1. This has the side effect that using `from .something import something`
      in a non-package will finally result in an import-error on Pylint's side.
      Until now relative_only was ignored, leading to the import of `something`,
      if it was globally available.
598
599
600

    * Add get_wrapping_class API to scoped_nodes, which can be used to
      retrieve the class that wraps a node.
601
602
603
604
605

    * Class.getattr looks by default in the implicit and the explicit metaclasses,
      which is `type` on Python 3.

      Closes issue #114.
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

    * There's a new separate step for transforms.

      Until now, the transforms were applied at the same time the tree was
      being built. This was problematic if the transform functions were
      using inference, since the inference was executed on a partially
      constructed tree, which led to failures when post-building
      information was needed (such as setting the _from_names
      for the From imports).
      Now there's a separate step for transforms, which are applied
      using transform.TransformVisitor.
      There's a couple of other related changes:

          * astroid.parse and AstroidBuilder gained a new parameter
            `apply_transforms`, which is a boolean flag, which will
            control if the transforms are applied. We do this because
            there are uses when the vanilla tree is wanted, without
            any implicit modification.

          * the transforms are also applied for builtin modules,
            as a side effect of the fact that transform visiting
            was moved in AstroidBuilder._post_build from
            AstroidBuilder._data_build.

      Closes issue #116.
631
632
633
634
635
636
637
    
    * Class._explicit_metaclass is now a public API, in the form of
      Class.declared_metaclass.

      Class.mro remains the de facto method for retrieving the metaclass
      of a class, which will also do an evaluation of what declared_metaclass
      returns.
638

639
640
641
642
643
    * Understand slices of tuples, lists, strings and instances with support
      for slices.

      Closes issue #137.

644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
    * Add proper grammatical names for `infered` and `ass_type` methods,
      namely `inferred` and `assign_type`.

      The old methods will raise PendingDeprecationWarning, being slated
      for removal in astroid 2.0.

    * Add new AST names in order to be similar to the ones
      from the builtin ast module.

      With this change, Getattr becomes Attributes, Backquote becomes
      Repr, Class is ClassDef, Function is FunctionDef,  Discard is Expr,
      CallFunc is Call, From is ImportFrom, AssName is AssignName
      and AssAttr is AssignAttr. The old names are maintained for backwards
      compatibility and they are interchangeable, in the sense that using
      Discard will use Expr under the hood and the implemented visit_discard
      in checkers will be called with Expr nodes instead. The AST does not
      contain the old nodes, only the interoperability between them hides this
Jakub Wilk's avatar
Jakub Wilk committed
661
      fact. Recommendations to move to the new nodes are emitted accordingly,
662
663
      the old names will be removed in astroid 2.0.

664
665
666
667
    * Add support for understanding class creation using `type.__new__(mcs, name, bases, attrs)``

      Until now, inferring this kind of calls resulted in Instances, not in classes,
      since astroid didn't understand that the presence of the metaclass in the call
Jakub Wilk's avatar
Jakub Wilk committed
668
      leads to a class creating, not to an instance creation.
669
670

    * Understand the `slice` builtin. Closes issue #184.
671
672

    * Add brain tips for numpy.core, which should fix Pylint's #453.
673
674
675
676
677
678
679
680
681

    * Add a new node, DictUnpack, which is used to represent the unpacking
      of a dictionary into another dictionary, using PEP 448 specific syntax
      ({1:2, **{2:3})

      This is a different approach than what the builtin ast module does,
      since it just uses None to represent this kind of operation,
      which seems conceptually wrong, due to the fact the AST contains
      non-AST nodes. Closes issue #206.
682
683
     

684

Claudiu Popa's avatar
Claudiu Popa committed
685
2015-03-14 -- 1.3.6
686
687
688
689

    * Class.slots raises NotImplementedError for old style classes.
      Closes issue #67.

690
691
692
693
694
695
    * Add a new option to AstroidManager, `optimize_ast`, which
      controls if peephole optimizer should be enabled or not.
      This prevents a regression, where the visit_binop method
      wasn't called anymore with astroid 1.3.5, due to the differences
      in the resulting AST. Closes issue #82.

David Douard's avatar
David Douard committed
696

Claudiu Popa's avatar
Claudiu Popa committed
697
698
2015-03-11 -- 1.3.5

699
700
701
702
703
704
    * Add the ability to optimize small ast subtrees,
      with the first use in the optimization of multiple
      BinOp nodes. This removes recursivity in the rebuilder
      when dealing with a lot of small strings joined by the
      addition operator. Closes issue #59.

705
706
    * Obtain the methods for the nose brain tip through an
      unittest.TestCase instance. Closes Pylint issue #457.
707
708
709

    * Fix a crash which occurred when a class was the ancestor
      of itself. Closes issue #78.
710
711
712
713
714
715
716
717
718

    * Improve the scope_lookup method for Classes regarding qualified
      objects, with an attribute name exactly as one provided in the
      class itself.

      For example, a class containing an attribute 'first',
      which was also an import and which had, as a base, a qualified name
      or a Gettattr node, in the form 'module.first', then Pylint would
      have inferred the `first` name as the function from the Class,
719
720
721
722
723
      not the import. Closes Pylint issue #466.

    * Implement the assigned_stmts operation for Starred nodes,
      which was omitted when support for Python 3 was added in astroid.
      Closes issue #36.
724
725
           

Claudiu Popa's avatar
Claudiu Popa committed
726
727
2015-01-17 -- 1.3.4

728
729
730
    * Get the first element from the method list when obtaining
      the functions from nose.tools.trivial. Closes Pylint issue #448.

Claudiu Popa's avatar
Claudiu Popa committed
731
2015-01-16 -- 1.3.3
Claudiu Popa's avatar
Claudiu Popa committed
732

Claudiu Popa's avatar
Claudiu Popa committed
733
734
735
736
737
738
739
740
741
    * Restore file_stream to a property, but deprecate it in favour of
      the newly added method Module.stream. By using a method instead of a
      property, it will be easier to properly close the file right
      after it is used, which will ensure that no file descriptors are
      leaked. Until now, due to the fact that a module was cached,
      it was not possible to close the file_stream anywhere.
      file_stream will start emitting PendingDeprecationWarnings in
      astroid 1.4, DeprecationWarnings in astroid 1.5 and it will
      be finally removed in astroid 1.6.
Claudiu Popa's avatar
Claudiu Popa committed
742

743
    * Add inference tips for 'tuple', 'list', 'dict' and 'set' builtins.
744

745
746
    * Add brain definition for most string and unicode methods

747
748
749
750
751
    * Changed the API for Class.slots. It returns None when the class
      doesn't define any slots. Previously, for both the cases where
      the class didn't have slots defined and when it had an empty list
      of slots, Class.slots returned an empty list.

752
753
754
    * Add a new method to Class nodes, 'mro', for obtaining the
      the method resolution order of the class.

755
756
    * Add brain tips for six.moves. Closes issue #63.

757
758
759
    * Improve the detection for functions decorated with decorators
      which returns static or class methods.

760
761
    * .slots() can contain unicode strings on Python 2.

762
763
    * Add inference tips for nose.tools.

764

Torsten Marek's avatar
Torsten Marek committed
765
766
2014-11-22 -- 1.3.2

Torsten Marek's avatar
Torsten Marek committed
767
768
769
770
771
772
773
774
    * Fixed a crash with invalid subscript index.
 
    * Implement proper base class semantics for Python 3, where
      every class derives from object.

    * Allow more fine-grained control over C extension loading
      in the manager.

775
776
777
778
2014-11-21 -- 1.3.1
   
    * Fixed a crash issue with the pytest brain module.

779
780
2014-11-20 -- 1.3.0

Jakub Wilk's avatar
Jakub Wilk committed
781
    * Fix a maximum recursion error occurred during the inference,
782
783
784
      where statements with the same name weren't filtered properly.
      Closes pylint issue #295.

785
786
787
    * Check that EmptyNode has an underlying object in
      EmptyNode.has_underlying_object.

788
789
    * Simplify the understanding of enum members.

790
791
792
    * Fix an infinite loop with decorator call chain inference,
      where the decorator returns itself. Closes issue #50.

Claudiu Popa's avatar
Claudiu Popa committed
793
794
    * Various speed improvements. Patch by Alex Munroe.

795
796
    * Add pytest brain plugin. Patch by Robbie Coomber.

Torsten Marek's avatar
Torsten Marek committed
797
798
799
800
801
    * Support for Python versions < 2.7 has been dropped, and the
      source has been made compatible with Python 2 and 3. Running
      2to3 on installation for Python 3 is not needed anymore.

    * astroid now depends on six.
802

803
804
805
    * modutils._module_file opens __init__.py in binary mode.
      Closes issues #51 and #13.

Torsten Marek's avatar
Torsten Marek committed
806
807
808
809
810
811
812
813
814
815
816
817
818
    * Only C extensions from trusted sources (the standard library)
      are loaded into the examining Python process to build an AST
      from the live module.

    * Path names on case-insensitive filesystems are now properly
      handled. This fixes the stdlib detection code on Windows.

    * Metaclass-generating functions like six.with_metaclass
      are now supported via some explicit detection code.

    * astroid.register_module_extender has been added to generalize
      the support for module extenders as used by many brain plugins.

819
    * brain plugins can now register hooks to handle failed imports, 
Torsten Marek's avatar
Torsten Marek committed
820
821
      as done by the gobject-introspection plugin.

822
823
824
    * The modules have been moved to a separate package directory,
      `setup.py develop` now works correctly.

825

Claudiu Popa's avatar
Claudiu Popa committed
826
827
2014-08-24 -- 1.2.1

828
829
830
    * Fix a crash occurred when inferring decorator call chain.
      Closes issue #42.

831
832
833
    * Set the parent of vararg and kwarg nodes when inferring them.
      Closes issue #43.

834
835
    * namedtuple inference knows about '_fields' attribute.

836
837
    * enum members knows about the methods from the enum class.

838
839
840
841
    * Name inference will lookup in the parent function
      of the current scope, in case searching in the current scope
      fails.

842
843
844
    * Inference of the functional form of the enums takes into
      consideration the various inputs that enums accepts.

845
846
847
    * The inference engine handles binary operations (add, mul etc.)
      between instances.

848
849
850
851
    * Fix an infinite loop in the inference, by returning a copy
      of instance attributes, when calling 'instance_attr'.
      Closes issue #34 (patch by Emile Anclin).

852
853
854
    * Don't crash when trying to infer unbound object.__new__ call.
      Closes issue #11.

855
2014-07-25  --  1.2.0
856
857
858

    * Function nodes can detect decorator call chain and see if they are
      decorated with builtin descriptors (`classmethod` and `staticmethod`).
859

860
861
862
    * infer_call_result called on a subtype of the builtin type will now
      return a new `Class` rather than an `Instance`.

863
864
865
    * `Class.metaclass()` now handles module-level __metaclass__ declaration
      on python 2, and no longer looks at the __metaclass__ class attribute on
      python 3.
Claudiu Popa's avatar
Claudiu Popa committed
866

867
868
869
870
    * Function nodes can detect if they are decorated with subclasses
      of builtin descriptors when determining their type
      (`classmethod` and `staticmethod`).

Claudiu Popa's avatar
Claudiu Popa committed
871
872
    * Add `slots` method to `Class` nodes, for retrieving
      the list of valid slots it defines.
873

874
875
876
877
    * Expose function annotation to astroid: `Arguments` node
      exposes 'varargannotation', 'kwargannotation' and 'annotations'
      attributes, while `Function` node has the 'returns' attribute.

878
879
880
881
    * Backported most of the logilab.common.modutils module there, as
      most things there are for pylint/astroid only and we want to be
      able to fix them without requiring a new logilab.common release

Jakub Wilk's avatar
Jakub Wilk committed
882
    * Fix names grabbed using wildcard import in "absolute import mode"
883
      (ie with absolute_import activated from the __future__ or with
884
885
      python 3). Fix pylint issue #58.

886
887
    * Add support in pylint-brain for understanding enum classes.

Sylvain Thénault's avatar
1.1.1    
Sylvain Thénault committed
888
2014-04-30  --  1.1.1
889
890
891
    * `Class.metaclass()` looks in ancestors when the current class
      does not define explicitly a metaclass.

892
893
894
895
    * Do not cache modules if a module with the same qname is already
      known, and only return cached modules if both name and filepath
      match. Fixes pylint Bitbucket issue #136.

Sylvain Thénault's avatar
Sylvain Thénault committed
896
2014-04-18  --  1.1.0
Claudiu Popa's avatar
Claudiu Popa committed
897
    * All class nodes are marked as new style classes for Py3k.
898

899
    * Add a `metaclass` function to `Class` nodes to
Claudiu Popa's avatar
Claudiu Popa committed
900
      retrieve their metaclass.
901
902
903

    * Add a new YieldFrom node.

904
905
    * Add support for inferring arguments to namedtuple invocations.

906
907
908
    * Make sure that objects returned for namedtuple
      inference have parents.

909
910
    * Don't crash when inferring nodes from `with` clauses
      with multiple context managers. Closes #18.
911

912
913
914
    * Don't crash when a class has some __call__ method that is not
      inferable. Closes #17.

915
916
917
    * Unwrap instances found in `.ancestors()`, by using their _proxied
      class.

918

Sylvain Thénault's avatar
Sylvain Thénault committed
919

Sylvain Thénault's avatar
1.0.1    
Sylvain Thénault committed
920
921
922
2013-10-18  --  1.0.1
    * fix py3k/windows installation issue (issue #4)

923
924
    * fix bug with namedtuple inference (issue #3)

Sylvain Thénault's avatar
1.0.1    
Sylvain Thénault committed
925
926
927
928
929
930
931
    * get back gobject introspection from pylint-brain

    * fix some test failures under pypy and py3.3, though there is one remaining
      in each of these platform (2.7 tests are all green)



Sylvain Thénault's avatar
Sylvain Thénault committed
932
2013-07-29  --  1.0.0
933
934
935
    * Fix some omissions in py2stdlib's version of hashlib and
      add a small test for it.

936
937
938
    * Properly recognize methods annotated with abc.abstract{property,method}
      as abstract.

939
    * Allow transformation functions on any node, providing a
940
      `register_transform` function on the manager instead of the
941
942
     `register_transformer` to make it more flexible wrt node selection

943
944
945
    * Use the new transformation API to provide support for namedtuple
      (actually in pylint-brain, closes #8766)

946
947
    * Added the test_utils module for building ASTs and
      extracting deeply nested nodes for easier testing.
948

949
950
    * Add support for py3k's keyword only arguments (PEP 3102)

Sylvain Thénault's avatar
Sylvain Thénault committed
951
952
953
    * RENAME THE PROJECT to astroid


Emile Anclin's avatar
Emile Anclin committed
954

Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
955
2013-04-16  --  0.24.3
956
    * #124360 [py3.3]: Don't crash on 'yield from' nodes
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
957

958
    * #123062 [pylint-brain]: Use correct names for keywords for urlparse
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
959

960
    * #123056 [pylint-brain]: Add missing methods for hashlib
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
961

962
963
    * #123068: Fix inference for generator methods to correctly handle yields
      in lambdas.
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
964

965
966
    * #123068: Make sure .as_string() returns valid code for yields in
      expressions.
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
967

968
    * #47957: Set literals are now correctly treated as inference leaves.
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
969
970

    * #123074: Add support for inference of subscript operations on dict
971
      literals.
972

Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
973
974
975


2013-02-27  --  0.24.2
976
    * pylint-brain: more subprocess.Popen faking (see #46273)
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
977

Sylvain Thénault's avatar
Sylvain Thénault committed
978
    * #109562 [jython]: java modules have no __doc__, causing crash
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
979

980
    * #120646 [py3]: fix for python3.3 _ast changes which may cause crash
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
981

Sylvain Thénault's avatar
Sylvain Thénault committed
982
983
    * #109988 [py3]: test fixes

Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
984
985
986


2012-10-05  --  0.24.1
Sylvain Thénault's avatar
0.24.1    
Sylvain Thénault committed
987
    * #106191: fix __future__ absolute import w/ From node
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
988

989
990
    * #50395: fix function fromlineno when some decorator is splited on
      multiple lines (patch by Mark Gius)
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
991

Sylvain Thénault's avatar
Sylvain Thénault committed
992
    * #92362: fix pyreverse crash on relative import
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
993

994
    * #104041: fix crash 'module object has no file_encoding attribute'
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
995

Sylvain Thénault's avatar
0.24.1    
Sylvain Thénault committed
996
    * #4294 (pylint-brain): bad inference on mechanize.Browser.open
Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
997

Sylvain Thénault's avatar
0.24.1    
Sylvain Thénault committed
998
    * #46273 (pylint-brain): bad inference subprocess.Popen.communicate
Sylvain Thénault's avatar
Sylvain Thénault committed
999

Sylvain Thénault's avatar
0.24.3    
Sylvain Thénault committed
1000

For faster browsing, not all history is shown. View entire blame