Giter VIP home page Giter VIP logo

Comments (4)

PeterKenyon avatar PeterKenyon commented on September 17, 2024

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.

pfalcon avatar pfalcon commented on September 17, 2024

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.

PeterKenyon avatar PeterKenyon commented on September 17, 2024

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.

pfalcon avatar pfalcon commented on September 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.