Comments (4)
Not sure whether we should try to emulate python methods exactly
Deque objects support the following methods:
append(x) OK
appendleft(x) OK
clear() # one liner
count(x) # one liner
extend(iterable) # one liner
extendleft(iterable)
pop() OK
popleft() OK
not so easy....
remove(value)
reverse()
rotate(n)
maxlen
from micropython-lib.
MicroPython's zen is "do more with less". So, I'm going to add .extend(), because it's indeed one-liner. But there's no need to add all methods en-masse. It should happen on a case by case basis, and as long as you're writing your own code (vs trying to run existing), you of course have freedom to choose which methods to use and which not. All in all, anything can be added, as long as there's (good) argumentation why it's needed.
from micropython-lib.
Thanks Paul, I sort of thought that's where we? are going, I like it, ("Its not the code you write - its the code you don't write" as I keep telling people).
So the idea is NOT to be totally compatible but to have a compatible subset. OK
I can see that CPython does have the odd feature creep method, but I'm new to all this.
from micropython-lib.
So the idea is NOT to be totally compatible but to have a compatible subset. OK
Yes, because otherwise we can spend many-many years in development, and then will have a fully CPython-compatible software, which will be just 2 times smaller than it. It's not worth spending so much effort for such a mediocre result. We want to be order of magnitude smaller, and that necessitates being a subset. You can read more about these ideas in https://github.com/micropython/micropython/wiki/ContributorGuidelines
In the meantime, .extend() method was added.
from micropython-lib.
Related Issues (20)
- It's "offline" after 10+ seconds, use umqtt.simple HOT 4
- how to use ssl in umqtt.simple v1.4.0 HOT 5
- SECURITY: Requests module HTTPS - no server certificate verification. HOT 4
- SECURITY: Requests module leaks passwords & usernames for HTTP Basic Auth HOT 1
- umqtt.simple - socket connection timeout parameter
- [Aioble] Update Parameters request from Central not answered by Peripheral. HOT 2
- datetime module has issue with year 2038 problem
- aas-core3.0 desirable in python-ecosys?
- urequests still using HTTP/1.0 HOT 3
- Deque is not a deque HOT 2
- aiohttp TLS websocket fails for continously sending packages on ESP32 HOT 11
- aiohttp sends Sec-WebSocket-Key with in wrong with b'' envelope HOT 2
- BLE: Bluetooth Low Energy HOT 4
- python-ecosys/requests can not post Chinese, why not add `; charset=UTF-8` to Content-Type? HOT 2
- Why can't I install umqtt? HOT 2
- Handle MemoryError in aioble_central.py scanner event HOT 1
- 'TypeError: can't convert NoneType to int' using aioble on Pico W HOT 1
- Handling the # TODO: Handle failure in the _IRQ_ENCRYPTION_UPDATE event
- Feature request: support for the HTTP Digest authentication on the requests and/or the aiohttp HOT 3
- SX1262 LORA driver error: RuntimeError: Internal radio Status (2, 1) OpError 0x20 HOT 2
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 micropython-lib.