| 2577 | If the _Call has no name then it will match any name. |
| 2578 | """ |
| 2579 | def __new__(cls, value=(), name='', parent=None, two=False, |
| 2580 | from_kall=True): |
| 2581 | args = () |
| 2582 | kwargs = {} |
| 2583 | _len = len(value) |
| 2584 | if _len == 3: |
| 2585 | name, args, kwargs = value |
| 2586 | elif _len == 2: |
| 2587 | first, second = value |
| 2588 | if isinstance(first, str): |
| 2589 | name = first |
| 2590 | if isinstance(second, tuple): |
| 2591 | args = second |
| 2592 | else: |
| 2593 | kwargs = second |
| 2594 | else: |
| 2595 | args, kwargs = first, second |
| 2596 | elif _len == 1: |
| 2597 | value, = value |
| 2598 | if isinstance(value, str): |
| 2599 | name = value |
| 2600 | elif isinstance(value, tuple): |
| 2601 | args = value |
| 2602 | else: |
| 2603 | kwargs = value |
| 2604 | |
| 2605 | if two: |
| 2606 | return tuple.__new__(cls, (args, kwargs)) |
| 2607 | |
| 2608 | return tuple.__new__(cls, (name, args, kwargs)) |
| 2609 | |
| 2610 | |
| 2611 | def __init__(self, value=(), name=None, parent=None, two=False, |