[issue46507] enabling cProfile to profile code given as an argument "à la" timeit
Change by julien tayon : -- nosy: +matrixise ___ Python tracker <https://bugs.python.org/issue46507> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue46507] enabling cProfile to profile code given as an argument "à la" timeit
New submission from julien tayon : well, you want to use python3 -mcProfile -othis.prof 'oneliner in python to test something' And weirdly enough this normally expected behaviour does not work. It's because last argument is expected to be the path of the script name to profile. But, it can be fixed easily with no downside Since it is an expected behaviour and is minimal changing anything in documentation or news seems to superfluous An exemple of « this is a standard de fait » is the fact that the awesome module of vstinner timeit does this already. https://github.com/python/cpython/pull/30859 -- components: Library (Lib) messages: 411517 nosy: jul2, vstinner priority: normal pull_requests: 29042 severity: normal status: open title: enabling cProfile to profile code given as an argument "à la" timeit type: enhancement versions: Python 3.10, Python 3.11, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue46507> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16670] [docs] class Point in collections.namedtuples may be not that good example
New submission from julien tayon: Priority: low Keywords: documentation After watching http://www.youtube.com/watch?v=o9pEzgHorH0 (Stop writing classes by diedrich) I think the class Point example for the named tuples may be a wrong practice: http://docs.python.org/2/library/collections.html#collections.namedtuple Since complex basic types 1* does the same, (if x is real and y is imag) 2* does more (rotation, norms, symbolic notation with i) At my opnion pointing some code to http://bugs.python.org/issue1818 (if it is accepted) may be the case of use of the named tuple. -- assignee: docs@python components: Documentation messages: 177382 nosy: docs@python, julien.tayon priority: normal severity: normal status: open title: [docs] class Point in collections.namedtuples may be not that good example versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16670 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16249] unicode name accepts a punctuation glyph
New submission from julien tayon: I guess unicode variable names are restricted to letters, and that symbols and punctuation shoud be ignored (except _). I have tested other dots (punctuation) they dont work. Only http://www.fileformat.info/info/unicode/char/00b7/index.htm oddly enough has worked so far. $ python3.2 Python 3.2.3 (default, Sep 10 2012, 18:14:40) [GCC 4.6.3] on linux2 Type help, copyright, credits or license for more information. foo⋅bar=42 File stdin, line 1 foo⋅bar=42 ^ SyntaxError: invalid character in identifier print(ord(foo⋅bar[3])) 8901 foo·bar = 42 print(ord(foo·bar[3])) 183 I have sampled randomly in the same block as MIDDLE DOT and it seems to behave correctly. -- components: Interpreter Core messages: 173049 nosy: julien.tayon priority: normal severity: normal status: open title: unicode name accepts a punctuation glyph type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue16249] unicode name accepts a punctuation glyph
julien tayon added the comment: http://www.fileformat.info/info/unicode/char/b7/index.htm the unicode category is Po (Ponctuation). Empirically, it cannot start a variable name so according to the rules given in the lexical analyser it should be one of : Mn, Mc, Nd, Pc Which is not the case Po not in [ Mn, Mc, Nd, Pc ]. Modulo my weak brain, it does not seem right. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue16249 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com