[issue41657] Refactor for object source files variable in Makefile
New submission from Elian Mariano Gabriel : Refactoring in the Makefile is needed due a hard coded declaration to the 'OBJECT_OBJS' variable in the line 388. This hard coded declaration can be replaced by a pattern substitution function which assigns the 'OBJECT_OBJS' variable in this much simpler way: OBJECT_OBJS=$(patsubst %.c, %.o, $(wildcard Objects/*.c)) This assignment will facilitate the future builds because it is not need to add a new obj reference when created a new source code inside the 'Objects' folder. -- components: Build messages: 376045 nosy: ElianMariano priority: normal severity: normal status: open title: Refactor for object source files variable in Makefile type: enhancement ___ Python tracker <https://bugs.python.org/issue41657> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41657] Refactor for object source files variable in Makefile
Change by Elian Mariano Gabriel : -- keywords: +patch pull_requests: +21099 stage: -> patch review pull_request: https://github.com/python/cpython/pull/21993 ___ Python tracker <https://bugs.python.org/issue41657> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42439] Use of ternary operator instead of if and else in month calculation function
New submission from Elian Mariano Gabriel : Inside the file calendar.py, there are two functions which are supposed to calculate the previous and next month relative to the actual year and month. def _prevmonth(year, month): if month == 1: return year-1, 12 else: return year, month-1 def _nextmonth(year, month): if month == 12: return year+1, 1 else: return year, month+1 Because of the concise calculation that is being made by these functions, it would be convenient to use the ternary operator to calculate that. So, the result would be: def _prevmonth(year, month): return [year-1, 12] if month == 1 else [year, month-1] def _nextmonth(year, month): return [year+1, 1] if month == 12 else [year, month+1] -- components: Library (Lib) files: calendar.py messages: 381629 nosy: ElianMariano priority: normal severity: normal status: open title: Use of ternary operator instead of if and else in month calculation function versions: Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 Added file: https://bugs.python.org/file49614/calendar.py ___ Python tracker <https://bugs.python.org/issue42439> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue42439] Use of ternary operator instead of if and else in month calculation function
Change by Elian Mariano Gabriel : -- keywords: +patch pull_requests: +22358 stage: -> patch review pull_request: https://github.com/python/cpython/pull/23468 ___ Python tracker <https://bugs.python.org/issue42439> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com