Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed last year.
Improve this question
Is there a Rust equivalent of what bigInt is to python? If not, then what is the rationale behind not going with python's way of integer handling?
Yes there are. Search for "bigint" on crates.io and there are plenty of results. They are not in the standard library but that's nothing unusual for Rust. Rust's standard library is kept small intentionally to minimise binary size ease maintenance (among other reasons).
Because Rust is not Python, and there's no reason for it to "Pythonise". Rust is a systems programming language without GC and with a focus on performance. There are many ways you can go about implementing a BigInt type, and there is no universal "best" way to do it. The most performant implementation heavily depends on your particular use case, which again is why there are many crates you can choose from, depending on what you need exactly.
Related
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 months ago.
Improve this question
I have read the topic What do I use for a max-heap implementation in Python? that has been viewed more than 74k times as of today (meaning that many people came across the same issue) and I've been wondering what is the reason for not implementing max heap data type in the Python Standard Library? Negating or inverting the values and keeping them in min heap looks to me very ugly and introduces unnecessary overhead (we need to take care of applying the transformation ourselves twice).
Edit: As pointed by #Boris this issue has been already raised in enhancement request 27295 and rejected, in 2016. Here is Raymond Hettinger's justification:
Sorry James, we don't grow the APIs without sufficient demonstrated need; otherwise, we end-up with API sprawl. People with actual use cases haven't requested behavior (and the occasional one-off gets by negating the numeric argument). That is why the maxheap functions were intentionally made private.
FWIW, this module is very old and the core functions have long proven themselves sufficient to meet their use cases (like being used in an event loop to efficiently select the next scheduled event).
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
I am reading the book "Advanced Programming in the UNIX Environment"
This library is important because all contemporary UNIX systems, such as the ones described in this book, provide the library routines that are speciļ¬ed in the C standard.
I am very confused here about the word routine Coroutine - Wikipedia
Does it has any relations to coroutines?
No.
A "routine" is a series of instructions. Similar to a "function" or "program". The word "routine" is somewhat archaic (but "coroutine" is not).
Library routines means library functions. It has nothing to do with coroutines.
From my understand, coroutine is a specific efficient manipulation way when we handle a routine. the other ways include: multi-process and multi-thread as you may be familiar with.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I'm a beginner programmer . I want to build an OS using Python and assembly . And for that I guess I will have to control the hardware. My question is " Is it possible to control computer's hardware parts using python ."
Unfortunately Python is classified as a very high level programming
language. It cannot be used, for example, to directly access
hardware and perform low-level data structure manipulation. It is
completely dependent on something to abstract the hardware from it,
and that is the Kernel. It is, however, technically possible to create
an operating system centered on Python, that is; have only the very
low level stuff in written in C and assembly and have most of the rest
of the operating system written in Python.
This article discusses with more detail what languages are
suitable for writing operating system kernels.
More
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 9 years ago.
Improve this question
is PEP8 simply a style guide, or does it actually help the interpreter make optimizations to run your code faster? I'm simply curious since I really like PEP8 and wanted to know of any other benefits other than more readable code.
There is a single item in PEP8 that clearly has potential performance consequences:
Code should be written in a way that does not disadvantage other implementations of Python (PyPy, Jython, IronPython, Cython, Psyco, and such).
That is, PEP8 recommends that code be written such that it performs well across a variety of Python implementations. This is a bit hand-wavy, of course (do you have to try all the available implementations?).
Other than that, nothing in PEP8 stands out as likely to impact performance or anything measurable apart from the storage space required for the code itself (e.g. four-space indentation).
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
What datastructures should a junior python developer study first?
UPDATE:
I mean common datastructures, not python list, dict and tuple...
The best reference for learning python is the python standard library itself. As for data structures, if you want to go deeper than the standard python type, you can study the collections module. Have a look at the docs and see how it is implemented.
For instance with IPython, you can access the documentation of any object or module by appending "?" and the code by appending "??" (without the quotes).
To go beyond the standard library you can explore PyPI which is the Python package Index, a repository of community contributed Python modules.
Pick packages with high weights and not marked alpha if possible.
For instance, on data structures you have :
http://pypi.python.org/pypi/data-structures/0.1.2
http://pypi.python.org/pypi/structures/0.5
I think that looking at real code is the best to learn real programming.