Python: Re-introduce abstract toString

This seems like the easier solution in the short run.
This commit is contained in:
Taus
2021-04-13 16:08:41 +00:00
committed by GitHub
parent a404faa302
commit a6bb9ebb9f
2 changed files with 5 additions and 2 deletions

View File

@@ -157,7 +157,7 @@ module API {
/**
* Gets a textual representation of this element.
*/
string toString() { none() }
abstract string toString();
/**
* Gets a path of the given `length` from the root to this node.

View File

@@ -20,7 +20,10 @@ abstract deprecated class PEP249Module extends DataFlow::Node { }
* An abstract class encompassing API graph nodes that implement PEP 249.
* Extend this class for implementations.
*/
abstract class PEP249ModuleApiNode extends API::Node { }
abstract class PEP249ModuleApiNode extends API::Node {
/** Gets a string representation of this element. */
override string toString() { result = this.(API::Node).toString() }
}
/** Gets a reference to a connect call. */
DataFlow::Node connect() { result = any(PEP249ModuleApiNode a).getMember("connect").getAUse() }