Comments (3)
I think for
middle
it would be a relatively simple change, but it is a 3.7+ change. Just a thought.
It may be simple, yes, but I intend to support Python 3.6 yet for middle
0.3.x. I know that middle
uses some metaclass
magic and perhaps I could workaround that, but I feel this would not be possible since middle
evaluates the classes during declaration - or I could lazily evaluate them as they are registered and replacing the defined classes in runtime. Hmmm, this does need some testing to see if it can be done with Python 3.6 and would not break evaluation ...
from middle.
I have not tried it... but does middle accept string annotations?
class Foo:
bars: List["Bar"]
from middle.
I have not tried it... but does middle accept string annotations?
Nope, a str
is a str
(for now). I was thinking about:
class Foo:
bars: List[middle.lazy("Bar")]
Instead of the lazy annotations, but this will fall into the same problem as I mentioned earlier: lazily evaluate the entire class only when all classes are available and reload them inside sys.modules
... A bit hacky, I don't know if it'll work properly but it'll be almost the same thing as the metaclass
making this magic (I guess).
from middle.
Related Issues (18)
- Increase code coverage HOT 1
- Subscribe system for validators and etc
- Aliases and alternate keys
- Read-only and write-only fields
- Does not work with EnumMeta HOT 2
- Input / output groups for larger objects HOT 1
- Better error handling HOT 2
- Setting fixed length to a string HOT 4
- Problem with `Optional` in more complex definitions
- Fine grain control on converters
- Drop Python 3.5 support
- Drop attrs depepdency
- Date and datetime objects HOT 1
- Documentation
- Proper benchmarking
- Types support HOT 1
- Respect `mro` order
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from middle.