pylint-dev / pylint-dev/astroid

Metaclass evaluation

Open
#173 1 comment 0 reactions 0 assignees View on GitHub
Enhancement ✨
Dominant language
Python
Stars
582
Forks
357
Avg merge
1d 1h
Merged PRs (30d)
23

Description

Originally reported by: **Claudiu Popa (BitBucket: [PCManticore](http://bitbucket.org/PCManticore), GitHub: @PCManticore)**

---

There's a big potential of improvements regarding the metaclasses. We should definitely have some sort of evaluation, for code such as the following:

```
#!python

import six

class A(type):
def __call__(cls):
return 42

@six.add_metaclass(A)
class B(object):
pass

b = B()
print(b.f) # b is an integer

```

---
- Bitbucket: https://bitbucket.org/logilab/astroid/issue/173

Contributor guide

No contributing guide indexed for this repository

Research direction

No source files or tests are named. Start by reproducing the `six.add_metaclass` example and tracing astroid's metaclass evaluation and inference behavior; clarify the intended result and scope before implementation. Done should include a defined evaluation behavior for the example and regression coverage.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
devtools
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.