Cannot subclass due to bad metaclass magic
See original GitHub issueIt’s impossible to inherit from the Faker class due to bad metaclass magic;
class Faker2(Faker):
pass
File "/vagrant/server/app/api/tests.py", line 44, in <module>
class Faker2(Faker):
TypeError: Error when calling the metaclass bases
first argument must be callable
Issue Analytics
- State:
- Created 8 years ago
- Comments:6
Top Results From Across the Web
Subclass avoiding parent's metaclass - python - Stack Overflow
What you can try is re-create the class using a different metaclass, which doesn't have unwanted behaviour. For example, you could use type...
Read more >Problems once solved by a metaclass can be ... - Hacker News
Because metaclasses are classes, yes, classes whose instances are ... harmful: you have to start creating loads of explicit subclasses instead of one ......
Read more >Understanding Python metaclasses | ionel's codelog
If you use a function as the metaclass then subclasses won't inherit your function metaclass, but the type of whatever that function returned....
Read more >A Python Metaclass for "extra bad" errors in Google App Engine
By doing this, when the class ExtendedHandler is built (as an object), all of its attributes and all of its parent classes (or...
Read more >Python Metaclasses - Real Python
“Metaclasses are deeper magic than 99% of users should ever worry about. ... Still, understanding Python metaclasses is worthwhile, because it leads to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
There are some more problems, again due to the way this library has been constructed.
The following is an instruction from the README, which fails to work;
There is far too much import abuse and magic going on, this project is a good idea but the implementation is very broken. Are there any plans to re-structure this in a pythonic way?
This issue was closed because it has been inactive for 14 days since being marked as stale.