This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2011年12月15日 03:35 by Ramchandra Apte, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Messages (13) | |||
|---|---|---|---|
| msg149492 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2011年12月15日 03:35 | |
It would be nice to have prime-related and number theory functions in a new module or some existing module (like math). like this: >>> import prime >>> prime.isprime(7) True >>> prime.isprime(35) False >>> prime.primerange(10,18) (11,13,17) >>> prime.isperfect(6) #Is 6 a perfect number (http://en.wikipedia.org/wiki/Perfect_number) True >>> prime.factorize(60) {2:2,3:1,5:1} #2**2 * 3**1 * 5**1 |
|||
| msg149495 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2011年12月15日 03:59 | |
-1 in general. I think that's too domain specific to belong in stdlib. |
|||
| msg149496 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年12月15日 04:05 | |
I agree with Benjamin about this being too domain specific for stdlib. Also, I don't really see a good argument as to why this functionality is useful. -1 from me too. |
|||
| msg149503 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2011年12月15日 04:56 | |
I think math.sin is also domain-specific. |
|||
| msg149504 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2011年12月15日 04:58 | |
Hardly, being a widely applicable mathematical function. Also, it's in a C math library which is what Python's is originally based on. |
|||
| msg149505 - (view) | Author: Meador Inge (meador.inge) * (Python committer) | Date: 2011年12月15日 05:00 | |
On Wed, Dec 14, 2011 at 10:58 PM, Benjamin Peterson <report@bugs.python.org> wrote: > Hardly, being a widely applicable mathematical function. I was just typing a similar response. > Also, it's in a C math library which is what Python's is originally based on. Not just *a* C math library. *The* Standard C library! :-) |
|||
| msg149506 - (view) | Author: Benjamin Peterson (benjamin.peterson) * (Python committer) | Date: 2011年12月15日 05:01 | |
2011年12月15日 Meador Inge <report@bugs.python.org>: > > Not just *a* C math library. *The* Standard C library! :-) Quite! |
|||
| msg149509 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2011年12月15日 05:25 | |
Anybody else than Benjamin and Meador please comment on this. |
|||
| msg149512 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2011年12月15日 07:28 | |
> Anybody else than Benjamin and Meador please comment on this. I don't know why we would want to maintain this in the stdlib. We would also need a dedicated maintainer so that efficient algorithms are chosen and implemented. Such functions are available in PyCrypto by the way: https://www.dlitz.net/software/pycrypto/doc/#crypto-util-number |
|||
| msg149513 - (view) | Author: Alex Gaynor (alex) * (Python committer) | Date: 2011年12月15日 07:30 | |
I'll chip in my 2 cents as well and say this also seems too domain specific and not useful enough for the stdlib. |
|||
| msg149514 - (view) | Author: Ramchandra Apte (Ramchandra Apte) * | Date: 2011年12月15日 07:39 | |
On further thought, I have changed my mind. I think this is domain-specific. Shall we close this bug? |
|||
| msg149516 - (view) | Author: Mark Dickinson (mark.dickinson) * (Python committer) | Date: 2011年12月15日 08:13 | |
Agree with the -1s. |
|||
| msg149581 - (view) | Author: Martin v. Löwis (loewis) * (Python committer) | Date: 2011年12月15日 22:52 | |
maniram: the proper course is to publish such a module on PyPI. Then, if there is enough interest in it (after a few years), propose addition to the standard library. |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:24 | admin | set | github: 57812 |
| 2011年12月15日 22:52:10 | loewis | set | nosy:
+ loewis messages: + msg149581 |
| 2011年12月15日 08:29:50 | rhettinger | set | status: languishing -> closed resolution: rejected |
| 2011年12月15日 08:16:48 | Ramchandra Apte | set | status: open -> languishing |
| 2011年12月15日 08:13:18 | mark.dickinson | set | messages: + msg149516 |
| 2011年12月15日 07:39:05 | Ramchandra Apte | set | messages: + msg149514 |
| 2011年12月15日 07:30:13 | alex | set | nosy:
+ alex messages: + msg149513 |
| 2011年12月15日 07:28:16 | pitrou | set | nosy:
+ mark.dickinson, pitrou messages: + msg149512 versions: - Python 2.6, Python 3.1, Python 2.7, Python 3.2 |
| 2011年12月15日 05:25:31 | Ramchandra Apte | set | messages: + msg149509 |
| 2011年12月15日 05:01:30 | benjamin.peterson | set | messages: + msg149506 |
| 2011年12月15日 05:00:49 | meador.inge | set | messages: + msg149505 |
| 2011年12月15日 04:58:02 | benjamin.peterson | set | messages: + msg149504 |
| 2011年12月15日 04:56:22 | Ramchandra Apte | set | messages: + msg149503 |
| 2011年12月15日 04:05:54 | meador.inge | set | nosy:
+ meador.inge messages: + msg149496 |
| 2011年12月15日 03:59:37 | benjamin.peterson | set | nosy:
+ benjamin.peterson messages: + msg149495 |
| 2011年12月15日 03:36:16 | Ramchandra Apte | set | title: Add prime-related functions to Python -> Add prime-related and number theory functions to Python |
| 2011年12月15日 03:35:22 | Ramchandra Apte | create | |