@@ -147,9 +147,7 @@ class Value extends TObject {
147
147
* Class representing modules in the Python program
148
148
* Each `ModuleValue` represents a module object in the Python program.
149
149
*/
150
- class ModuleValue extends Value {
151
- ModuleValue ( ) { this instanceof ModuleObjectInternal }
152
-
150
+ class ModuleValue extends Value instanceof ModuleObjectInternal {
153
151
/**
154
152
* Holds if this module "exports" name.
155
153
* That is, does it define `name` in `__all__` or is
@@ -159,7 +157,7 @@ class ModuleValue extends Value {
159
157
predicate exports ( string name ) { PointsTo:: moduleExports ( this , name ) }
160
158
161
159
/** Gets the scope for this module, provided that it is a Python module. */
162
- ModuleScope getScope ( ) { result = this . ( ModuleObjectInternal ) .getSourceModule ( ) }
160
+ ModuleScope getScope ( ) { result = super .getSourceModule ( ) }
163
161
164
162
/**
165
163
* Gets the container path for this module. Will be the file for a Python module,
@@ -181,7 +179,7 @@ class ModuleValue extends Value {
181
179
predicate isPackage ( ) { this instanceof PackageObjectInternal }
182
180
183
181
/** Whether the complete set of names "exported" by this module can be accurately determined */
184
- predicate hasCompleteExportInfo ( ) { this . ( ModuleObjectInternal ) .hasCompleteExportInfo ( ) }
182
+ predicate hasCompleteExportInfo ( ) { super .hasCompleteExportInfo ( ) }
185
183
186
184
/** Get a module that this module imports */
187
185
ModuleValue getAnImportedModule ( ) { result .importedAs ( this .getScope ( ) .getAnImportedModuleName ( ) ) }
@@ -345,25 +343,21 @@ module Value {
345
343
* Callables include Python functions, built-in functions and bound-methods,
346
344
* but not classes.
347
345
*/
348
- class CallableValue extends Value {
349
- CallableValue ( ) { this instanceof CallableObjectInternal }
350
-
346
+ class CallableValue extends Value instanceof CallableObjectInternal {
351
347
/**
352
348
* Holds if this callable never returns once called.
353
349
* For example, `sys.exit`
354
350
*/
355
- predicate neverReturns ( ) { this . ( CallableObjectInternal ) .neverReturns ( ) }
351
+ predicate neverReturns ( ) { super .neverReturns ( ) }
356
352
357
353
/** Gets the scope for this function, provided that it is a Python function. */
358
354
FunctionScope getScope ( ) { result = this .( PythonFunctionObjectInternal ) .getScope ( ) }
359
355
360
356
/** Gets the `n`th parameter node of this callable. */
361
- NameNode getParameter ( int n ) { result = this . ( CallableObjectInternal ) .getParameter ( n ) }
357
+ NameNode getParameter ( int n ) { result = super .getParameter ( n ) }
362
358
363
359
/** Gets the `name`d parameter node of this callable. */
364
- NameNode getParameterByName ( string name ) {
365
- result = this .( CallableObjectInternal ) .getParameterByName ( name )
366
- }
360
+ NameNode getParameterByName ( string name ) { result = super .getParameterByName ( name ) }
367
361
368
362
/**
369
363
* Gets the argument in `call` corresponding to the `n`'th positional parameter of this callable.
@@ -452,23 +446,21 @@ class CallableValue extends Value {
452
446
* Class representing bound-methods, such as `o.func`, where `o` is an instance
453
447
* of a class that has a callable attribute `func`.
454
448
*/
455
- class BoundMethodValue extends CallableValue {
456
- BoundMethodValue ( ) { this instanceof BoundMethodObjectInternal }
457
-
449
+ class BoundMethodValue extends CallableValue instanceof BoundMethodObjectInternal {
458
450
/**
459
451
* Gets the callable that will be used when `this` is called.
460
452
* The actual callable for `func` in `o.func`.
461
453
*/
462
- CallableValue getFunction ( ) { result = this . ( BoundMethodObjectInternal ) .getFunction ( ) }
454
+ CallableValue getFunction ( ) { result = super .getFunction ( ) }
463
455
464
456
/**
465
457
* Gets the value that will be used for the `self` parameter when `this` is called.
466
458
* The value for `o` in `o.func`.
467
459
*/
468
- Value getSelf ( ) { result = this . ( BoundMethodObjectInternal ) .getSelf ( ) }
460
+ Value getSelf ( ) { result = super .getSelf ( ) }
469
461
470
462
/** Gets the parameter node that will be used for `self`. */
471
- NameNode getSelfParameter ( ) { result = this . ( BoundMethodObjectInternal ) .getSelfParameter ( ) }
463
+ NameNode getSelfParameter ( ) { result = super .getSelfParameter ( ) }
472
464
}
473
465
474
466
/**
@@ -831,12 +823,10 @@ class BuiltinMethodValue extends FunctionValue {
831
823
/**
832
824
* A class representing sequence objects with a length and tracked items.
833
825
*/
834
- class SequenceValue extends Value {
835
- SequenceValue ( ) { this instanceof SequenceObjectInternal }
836
-
837
- Value getItem ( int n ) { result = this .( SequenceObjectInternal ) .getItem ( n ) }
826
+ class SequenceValue extends Value instanceof SequenceObjectInternal {
827
+ Value getItem ( int n ) { result = super .getItem ( n ) }
838
828
839
- int length ( ) { result = this . ( SequenceObjectInternal ) .length ( ) }
829
+ int length ( ) { result = super .length ( ) }
840
830
}
841
831
842
832
/** A class representing tuple objects */
@@ -887,14 +877,12 @@ class NumericValue extends Value {
887
877
* https://docs.python.org/3/howto/descriptor.html#properties
888
878
* https://docs.python.org/3/library/functions.html#property
889
879
*/
890
- class PropertyValue extends Value {
891
- PropertyValue ( ) { this instanceof PropertyInternal }
892
-
893
- CallableValue getGetter ( ) { result = this .( PropertyInternal ) .getGetter ( ) }
880
+ class PropertyValue extends Value instanceof PropertyInternal {
881
+ CallableValue getGetter ( ) { result = super .getGetter ( ) }
894
882
895
- CallableValue getSetter ( ) { result = this . ( PropertyInternal ) .getSetter ( ) }
883
+ CallableValue getSetter ( ) { result = super .getSetter ( ) }
896
884
897
- CallableValue getDeleter ( ) { result = this . ( PropertyInternal ) .getDeleter ( ) }
885
+ CallableValue getDeleter ( ) { result = super .getDeleter ( ) }
898
886
}
899
887
900
888
/** A method-resolution-order sequence of classes */
0 commit comments