[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17719 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18328 ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
New submission from Ananthakrishnan : Add binary module that has binary operations like: binary addition. binary subtracion. binary multiplication. binary division. compliment. 1's complement. 2's complement. cconverting to various number system. converting to BCD. converting to grey code. K-Map function and so on.. -- components: C API messages: 362045 nosy: Ananthakrishnan priority: normal severity: normal status: open title: Add Binary module. type: enhancement versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Change by Ananthakrishnan : -- nosy: +mark.dickinson, serhiy.storchaka, tim.peters -Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Ananthakrishnan added the comment: It is "addition". I meant binary addition: 1110+1010=11000. -1000=0111 -- ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Ananthakrishnan added the comment: It operates only on 0 and 1 -- ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Change by Ananthakrishnan : -- components: +Library (Lib) -C API ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Ananthakrishnan added the comment: I meant a module for "binary number". It can do operations on binary number. -- ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39644] Add Binary module.
Ananthakrishnan added the comment: I think this is not present in python. This module should contain operations that can be performed on binary numbers. In the below examples a and b are binary numbers. binary.add(a,b) binary.sub(a,b) binary.mul(a,b) binary.div(a,b) binary.ones_complement(a)//returns 1's complement of a. binary.twos_complement(a)//returns 2's complement of a. binary.dectobi(a)//converts decimal "a" to binary of "a". binary.bcd(a)//returns bcd of a. binary.gray(a) //returns grey code of a. binary.min() //minimizes. binarybitodec//converts binar "a" to decimal of "a". -- ___ Python tracker <https://bugs.python.org/issue39644> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
New submission from Ananthakrishnan : If we have to find the gcd of three or more numbers, now we should use gcd(a, gcd(b, gcd(c, gcd(d, e) which will create lot of problems. math.gcd should take "n" number of arguments,like: gcd(a,b,c,) gcd(4,6,8)//returns 2 gcd(2,5,8,6)//returns 1 gcd(6,30,40,60,20,40)//returns 2 -- components: Library (Lib) messages: 362069 nosy: Ananthakrishnan, mark.dickinson, serhiy.storchaka, steven.daprano priority: normal severity: normal status: open title: Update math.gcd() to accept "n" arguments. versions: Python 3.9 ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: It will take more time to write the statement itself and there are chances of getting mistakes as the statement is complicated. -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: It should take variable number of positional arguments. it should return: >>math.gcd() 0 >>math.gcd(8) 8 >>math.gcd(-8) 8 -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue9182] document “--” as a way to distinguish option w/ narg='+' from positional argument in argparse
Ananthakrishnan added the comment: Is this issue still needed? Can I add a pull request for this. -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue9182> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue36184] [EASY] test_gdb.test_threads() is specific to _POSIX_THREADS, fail on FreeBSD
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17915 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18538 ___ Python tracker <https://bugs.python.org/issue36184> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Change by Ananthakrishnan : -- pull_requests: +17925 pull_request: https://github.com/python/cpython/pull/18547 ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: Can I put together a PR for this issue? -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39635] One paragraph of the doc is not translated in French
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17932 stage: -> patch review pull_request: https://github.com/python/cpython/pull/1153 ___ Python tracker <https://bugs.python.org/issue39635> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39572] [typing] TypedDict's 'total' argument is undocumented
Ananthakrishnan added the comment: https://stackoverflow.com/questions/58427394/what-is-the-meaning-of-total-dunder-attribute-in-python-3 questions about this. -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue39572> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39572] [typing] TypedDict's 'total' argument is undocumented
Ananthakrishnan added the comment: It will be usefull if we document _total_ argument also. -- ___ Python tracker <https://bugs.python.org/issue39572> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39572] [typing] TypedDict's 'total' argument is undocumented
Ananthakrishnan added the comment: yes,I'm interested. -- ___ Python tracker <https://bugs.python.org/issue39572> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39572] [typing] TypedDict's 'total' argument is undocumented
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17935 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/18554 ___ Python tracker <https://bugs.python.org/issue39572> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39572] [typing] TypedDict's 'total' argument is undocumented
Ananthakrishnan added the comment: yes,I'm interested in writing docs for the `__required_keys__` and `__total_keys__` attributes. -- ___ Python tracker <https://bugs.python.org/issue39572> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17422] language reference should specify restrictions on class namespace
Change by Ananthakrishnan : -- pull_requests: +17939 pull_request: https://github.com/python/cpython/pull/18559 ___ Python tracker <https://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17422] language reference should specify restrictions on class namespace
Ananthakrishnan added the comment: I just addded a PR for this issue. -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue17422> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39560] PyUnicode_FromKindAndData kind transformation is not documented
Ananthakrishnan added the comment: Can i add a pull request for this. -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue39560> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39379] sys.path[0] is already absolute path
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17941 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18561 ___ Python tracker <https://bugs.python.org/issue39379> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue38872] Document exec symbol for codeop.compile_command
Ananthakrishnan added the comment: code.compile_command takes _exec_ as symbol.As it is not documented or mentioned anywhere I can't find any details about that.Can anyone please tell me what it does? -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue38872> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6083] Reference counting bug in PyArg_ParseTuple and PyArg_ParseTupleAndKeywords
Ananthakrishnan added the comment: I want to do a PR,if this is still needeed. -- nosy: +Ananthakrishnan ___ Python tracker <https://bugs.python.org/issue6083> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: This is my code for math.gcd: static PyObject * math_gcd(PyObject *module, PyObject *args, Py_ssize_t n) { PyObject *g = 0, *item, *in; Py_ssize_t i; for (i = 0; i < n; i++) { item = args[i]; in = PyNumber_Index(item); if (in == NULL) { return NULL; } g = _PyLong_GCD(g, in); } Py_DECREF(in); return g; } This is showing an error: error: incompatible types when assigning to type ‘PyObject * {aka struct _object *}’ from type ‘PyObject {aka struct _object}’ item = args[i]; ^^^ -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: Yes I know. -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: Thanks for the hint.Made changes. -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Change by Ananthakrishnan : -- keywords: +patch pull_requests: +17959 stage: -> patch review pull_request: https://github.com/python/cpython/pull/18590 ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39648] Update math.gcd() to accept "n" arguments.
Ananthakrishnan added the comment: >>Sorry, Ananthakrishnan, but I think this problem is too difficult to you. >>Adding math.lcm() taken 2 weeks and produced 200 messages. It is simpler to >>implement this feature myself to me. I'm a beginner.Not everyone is perfect at begenning. I am starting this.So I took some problems myself as i saw the problems here are difficult.You should have given me a chance. I think you should have at the same situations once,like the situations that I'm facing now. -- ___ Python tracker <https://bugs.python.org/issue39648> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39478] can we add a median function
New submission from Ananthakrishnan A S : add a function called 'median' that we can use like: list=[1,2,3,4,5,6,7,8,9] # declaring list median(list) #returns 5 -- components: Library (Lib) messages: 360873 nosy: Ananthakrishnan A S priority: normal severity: normal status: open title: can we add a median function type: enhancement versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue39478> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] can we add a lcm and gcd function.
New submission from Ananthakrishnan A S : can we add an lcm and gcd function that can work as: lcm(4,6) # returns 12 gcd(4,6) # returns 2 -- components: Library (Lib) messages: 360875 nosy: Ananthakrishnan A S priority: normal severity: normal status: open title: can we add a lcm and gcd function. type: enhancement versions: Python 3.8 ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Ananthakrishnan A S added the comment: I created this issue as i came across the following question: There are n students in class A,and m students in class B.each class divides into teams for a competition.What is the biggest possible team size that can be divided,such that each team has same number of members. We can solve this type of problems easily if we have lcm() in math library.And there are lots of real life applications where we have to use lcm. -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Ananthakrishnan A S added the comment: Should i proceed with adding a pull request for adding a 'lcm' function in python's math module. -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Ananthakrishnan A S added the comment: some problems that needs lcm function: 1:find the least number which when divided by 'a','b','c','d' leaves remainder 'e' in each case. 2:person A exercises every 'n' days and person B every 'm' days. A and B both exercised today. How many days will it be until they exercise together again? 3:The LCM is important when adding fractions which have different denominators we have to use the lcm function when, 1) an event that is or will be repeating over and over. 2) To purchase or get multiple items in order to have enough. 3) To figure out when something will happen again at the same time. All these shows lcm function should be included in the math library. So can i proceed with adding pull request to add lcm function in python's math module. -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Ananthakrishnan A S added the comment: I agree with Vedran Čačić.As the modules are not made for one person but it is for the ease of coding.There are so many functions which i don't use but used by other people.We are using functions to make coding easy and if lcm function is added many people will find it usefull. -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue39479] [RFE] Add math.lcm() function: Least Common Multiple
Ananthakrishnan A S added the comment: Yes,I want to put together a PR. -- ___ Python tracker <https://bugs.python.org/issue39479> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com