/IronPython_Main/Tools/IronStudio/IronPythonToolsCore/PyAnalysis/Values/ListPopBoundBuiltinMethodInfo.cs

# · C# · 38 lines · 18 code · 4 blank · 16 comment · 0 complexity · da156ee2c22303000c347a685e7601f7 MD5 · raw file

  1. /* ****************************************************************************
  2. *
  3. * Copyright (c) Microsoft Corporation.
  4. *
  5. * This source code is subject to terms and conditions of the Apache License, Version 2.0. A
  6. * copy of the license can be found in the License.html file at the root of this distribution. If
  7. * you cannot locate the Apache License, Version 2.0, please send an email to
  8. * ironpy@microsoft.com. By using this source code in any fashion, you are agreeing to be bound
  9. * by the terms of the Apache License, Version 2.0.
  10. *
  11. * You must not remove this notice, or any other, from this software.
  12. *
  13. * ***************************************************************************/
  14. using System;
  15. using System.Collections.Generic;
  16. using System.Linq;
  17. using System.Text;
  18. using Microsoft.PyAnalysis.Interpreter;
  19. using IronPython.Compiler.Ast;
  20. namespace Microsoft.PyAnalysis.Values {
  21. /// <summary>
  22. /// Represents list.pop on a list with known type information.
  23. /// </summary>
  24. class ListPopBoundBuiltinMethodInfo : BoundBuiltinMethodInfo {
  25. private readonly ListInfo _list;
  26. public ListPopBoundBuiltinMethodInfo(ListInfo list, BuiltinMethodInfo method)
  27. : base(method) {
  28. _list = list;
  29. }
  30. public override ISet<Namespace> Call(Node node, AnalysisUnit unit, ISet<Namespace>[] args, string[] keywordArgNames) {
  31. return _list.UnionType;
  32. }
  33. }
  34. }