; Python pattern detection queries
; Captures: @node (pattern site), @name (identifier)

; Singleton: __new__ override
(function_definition
  name: (identifier) @name
  (#eq? @name "__new__")) @node

; Decorator pattern (direct decorator call)
(decorated_definition
  (decorator
    (call
      function: (identifier) @name))) @node

; Decorator pattern (attribute decorator like @app.route)
(decorated_definition
  (decorator
    (call
      function: (attribute
        attribute: (identifier) @name)))) @node

; Context manager class (__enter__)
(function_definition
  name: (identifier) @name
  (#eq? @name "__enter__")) @node
