[issue45872] Turtle documentation, write()

2021-11-22 Thread Pavel V
New submission from Pavel V : There are no parentheses for 'font' argument in turtle.write() documentation https://docs.python.org/3.10/library/turtle.html#turtle.write -- assignee: docs@python components: Documentation messages: 406795 nosy: docs@python, willyns priority: normal

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
pavel-lexyr added the comment: Thank you all for your input! Migrating the discussion to https://mail.python.org/archives/list/python-id...@python.org/thread/UQRCDWMFNC5NRLLQCTYPOEGWJOIV7BGJ/ for now, if anyone wants to continue. -- resolution: rejected

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
Change by pavel-lexyr : -- resolution: -> rejected ___ Python tracker <https://bugs.python.org/issue44768> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
Change by pavel-lexyr : -- versions: -Python 3.10, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issue44

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
pavel-lexyr added the comment: Touche. Another advantage a namedtuple has is that it can expand out of the box - i.e., can write something like > for x, y, z in namedtuple_list: without any list comprehensions. Can we bring those advantages into the dataclass while also preserv

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
pavel-lexyr added the comment: Most of the differences are direct upgrades added in the dataclass module. Deprecating dataclass in favour of nametuple would be counterproductive, I agree - what about vice versa? -- ___ Python tracker <ht

[issue44765] Misspelled Word In Docs

2021-07-28 Thread pavel-lexyr
Change by pavel-lexyr : -- keywords: +patch nosy: +pavel-lexyr nosy_count: 3.0 -> 4.0 pull_requests: +25959 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/27430 ___ Python tracker <https://bugs.p

[issue44768] dataclasses.dataclass and collections.namedtuple do the same thing

2021-07-28 Thread pavel-lexyr
New submission from pavel-lexyr : PEP 20 states: > There should be one-- and preferably only one --obvious way to do it. As of right now, two very similar constructions for making a lightweight dataclass exist in Python. collections.namedtuple is one of them. dataclasses.datacl

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-16 Thread Pavel Moiseenko
Pavel Moiseenko added the comment: @paul.moore, but you don't need to open additional menus in the control panel to see the version of the app. -- ___ Python tracker <https://bugs.python.org/issue44

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-15 Thread Pavel Moiseenko
Pavel Moiseenko added the comment: This does not cause any problems in the operation of the app, but visually it looks strange. Most other apps don't indicate the version of the app in the name of the app, but just indicate it in a specially made field for this. Therefore, it would be nice

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-14 Thread Pavel Moiseenko
Change by Pavel Moiseenko : Added file: https://bugs.python.org/file50148/2021-07-14 13-50-19 Programs and Features.png ___ Python tracker <https://bugs.python.org/issue44

[issue44634] Version is duplicated in name of app in list of installed apps

2021-07-14 Thread Pavel Moiseenko
New submission from Pavel Moiseenko : The version of the app is duplicated in the name of the app in the list of installed apps in "Settings - Apps - Apps & features" and "Control Panel - Programs - Programs and Features" in the version for Windows. Please remove

[issue44571] itertools: takedowhile()

2021-07-12 Thread pavel-lexyr
pavel-lexyr added the comment: Thank you - that answers the questions. The use case where we would want to know if the last element is transitional or not completely slipped my mind for some reason. -- ___ Python tracker <https://bugs.python.

[issue44571] itertools: takedowhile()

2021-07-12 Thread pavel-lexyr
pavel-lexyr added the comment: There is a core part of the `takedowhile` proposal's use case that I am having trouble envisioning via the alternative `before_and_after` proposal. If the `after` part of the iterator the user does not engage with, the transitional elements will be stuck

[issue44571] itertools: takedowhile()

2021-07-05 Thread pavel-lexyr
pavel-lexyr added the comment: I see. If the syntax allows for better ways to do it now, perhaps a move towards deprecation would be a better idea then? This would agree with the Zen. Also, please elaborate more on the generator-based solutions you have in mind. The suggestion stems from

[issue44571] itertools: takedowhile()

2021-07-05 Thread pavel-lexyr
New submission from pavel-lexyr : As described in the documentation, itertools.takewhile() returns all the elements until the first one that does not match the provided criterion. In case of a destructive iterator, or one with side effects, not yielding an element downstream may render

[issue44528] Move IP version resolving to http.server's API

2021-06-28 Thread pavel-lexyr
New submission from pavel-lexyr : Python's native HTTP server (http.server module) has special code to allow it to detect and bind to IPv6 addresses when called as a CLI tool. As of right now, the code is in private functions. Those are not intended to be called by library users - only

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-11 Thread Pavel Ditenbir
Change by Pavel Ditenbir : -- versions: -Python 3.6, Python 3.7 ___ Python tracker <https://bugs.python.org/issue42875> ___ ___ Python-bugs-list mailin

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-11 Thread Pavel Ditenbir
Change by Pavel Ditenbir : -- versions: +Python 3.10, Python 3.6, Python 3.7, Python 3.8 ___ Python tracker <https://bugs.python.org/issue42875> ___ ___ Pytho

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-09 Thread Pavel Ditenbir
Change by Pavel Ditenbir : -- keywords: +patch pull_requests: +23003 stage: -> patch review pull_request: https://github.com/python/cpython/pull/24177 ___ Python tracker <https://bugs.python.org/issu

[issue42875] argparse incorrectly shows help string on a new line in case of long command string

2021-01-09 Thread Pavel Ditenbir
New submission from Pavel Ditenbir : Steps to reproduce. Run the attached script: $ python3 argparse-indent-sample.py --help The output is: usage: argparse-indent-sample.py [-h] CMD ... optional arguments: -h, --help show this help message and exit service: CMD

[issue34374] Shouldn't shutil.copyfile replace link in dst with follow_symlinks set?

2020-09-15 Thread Pavel Raiskup
Pavel Raiskup added the comment: Check out this default behavior of /bin/cp though: $ mkdir a b $ echo content > a/file $ ln -s non-existing b/file $ cp a/file b cp: not writing through dangling symlink 'b/file' Shouldn't shutil.copy*() refuse to write trough a dangl

[issue41293] fix confusing example in hashlib docs

2020-07-13 Thread Pavel Trukhanov
Change by Pavel Trukhanov : -- type: -> enhancement versions: +Python 3.10, Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9 ___ Python tracker <https://bugs.python.org/issu

[issue41293] fix confusing example in hashlib docs

2020-07-13 Thread Pavel Trukhanov
New submission from Pavel Trukhanov : The documentation found in https://docs.python.org/3/library/hashlib.html#hash-algorithms give us the following two examples: ``` For example, to obtain the digest of the byte string b'Nobody inspects the spammish repetition': >>> >>&

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Pavel Minaev
Pavel Minaev added the comment: Debuggers will have to work around this in past Python versions that they support (which still includes Python 2 for pretty much all of them), so this is solely about resolving the inconsistency for the future. No point rushing it for 3.8 specifically

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Pavel Minaev
Pavel Minaev added the comment: It's also possible to hit if using some native code that starts a background thread without going via threading, and runs Python code on that background thread. In that case, if that Python code then does "import threading", and threading hasn't bee

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Pavel Minaev
Pavel Minaev added the comment: This is a bit tricky to explain... There's no easy way to achieve this effect "normally". It manifests due to the way some Python debuggers (specifically, pydevd and ptvsd - as used by PyCharm, PyDev, and VSCode) implement non-cooperative

[issue37416] If threading is not imported from the main thread it sees the wrong thread as the main thread.

2019-06-27 Thread Pavel Minaev
Change by Pavel Minaev : -- nosy: +int19h ___ Python tracker <https://bugs.python.org/issue37416> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36919] Exception from 'compile' reports a newline char not present in input

2019-05-28 Thread Pavel Koneski
Change by Pavel Koneski : -- keywords: +patch pull_requests: +13535 stage: -> patch review pull_request: https://github.com/python/cpython/pull/13639 ___ Python tracker <https://bugs.python.org/issu

[issue36919] Exception from 'compile' reports a newline char not present in input

2019-05-20 Thread Pavel Koneski
Pavel Koneski added the comment: > I'm assuming the real issue is wanting to make IronPython pass as much of the > CPython test suite as possible. This is indeed the case. The CPython test suite is invaluable in guiding IronPython development. Most of the time, the tests are prett

[issue36919] Exception from 'compile' reports a newline char not present in input

2019-05-20 Thread Pavel Koneski
Change by Pavel Koneski : -- versions: -Python 3.5, Python 3.6 ___ Python tracker <https://bugs.python.org/issue36919> ___ ___ Python-bugs-list mailin

[issue36919] Exception from 'compile' reports a newline char not present in input

2019-05-20 Thread Pavel Koneski
Pavel Koneski added the comment: If "equivalent input" is acceptable, then it looks like case B: other implementations possibly having different forms of equivalent input. I am going to post this question on python-dev. -- versions: +Python 3.5,

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-05-18 Thread Pavel Kostyuchenko
Pavel Kostyuchenko added the comment: Also it might be viable to add some assertion to verify the take_gil is not called with uninitialized interpreter. I used the changes in the attachment (take_gil.assert.patch), but it produced errors during test_tracemalloc

[issue33608] Add a cross-interpreter-safe mechanism to indicate that an object may be destroyed.

2019-05-18 Thread Pavel Kostyuchenko
Pavel Kostyuchenko added the comment: I was able to reproduce the error with version f13c5c8b9401a9dc19e95d8b420ee100ac022208 on FreeBSD 12.0 VM. The error seems to be caused not by those changes, but by lack of synchronization in the multiprocessing.managers.Server. The failure happens

[issue36919] Exception form 'compile' reports a newline char not present in input

2019-05-14 Thread Pavel Koneski
New submission from Pavel Koneski : Since Python 3.2, input in 'exec' mode of 'compile' does not have to end in a newline anymore. However, it creates a surprising behavior when a 'SyntaxError' is reported: >>> try: compile('try', '', 'exec') ... except SyntaxError as ex: prin

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Shishmarev Pavel added the comment: https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L875 It's redundant to raise and then catch exception. I mean: if len(query) and not isinstance(query[0], tuple): ty, va, tb = sys.exc_info() raise TypeError("not a valid non-s

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Change by Shishmarev Pavel : -- pull_requests: +10288 ___ Python tracker <https://bugs.python.org/issue35447> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
Change by Shishmarev Pavel : -- keywords: +patch pull_requests: +10287 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35447> ___ _

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Shishmarev Pavel
New submission from Shishmarev Pavel : https://github.com/python/cpython/blob/master/Lib/urllib/parse.py#L875 It's redundant to raise and then catch exception. -- components: Library (Lib) messages: 331436 nosy: PashaWNN priority: normal severity: normal status: open title: Redundant

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Change by Pavel Jurkas : -- pull_requests: +7838 ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Pavel Jurkas added the comment: https://github.com/python/cpython/pull/8304 -- ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Python-bugs-list m

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Pavel Jurkas added the comment: https://github.com/python/cpython/pull/8302 -- ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Python-bugs-list m

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Change by Pavel Jurkas : -- pull_requests: +7836 ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Pavel Jurkas added the comment: https://github.com/python/cpython/pull/8301 -- ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Python-bugs-list m

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
Change by Pavel Jurkas : -- keywords: +patch pull_requests: +7835 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue34129> ___ ___ Py

[issue34129] CGITB does not mangle variables names

2018-07-16 Thread Pavel Jurkas
New submission from Pavel Jurkas : CGITB does not mangle private variables names. So they are displayed as undefined even though they are defined. Example: self.__core undefined -- messages: 321757 nosy: pjurkas priority: normal severity: normal status: open title: CGITB does

[issue14102] argparse: add ability to create a man page

2018-06-15 Thread Pavel Raiskup
Pavel Raiskup added the comment: On Friday, June 15, 2018 11:54:04 AM CEST Daniel Walsh wrote: > Correct, the reason I would want this is to add something to a Makefile > ... > manpages: foo.py > ./python foo.py --manpage > foo.1 The /bin/argparse-manpage could help temp

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pavel Raiskup
Pavel Raiskup added the comment: On Friday, June 15, 2018 1:52:41 AM CEST Ben Finney wrote: > On Thu, 2018-06-14 23:46 +, Aaron Meurer wrote: > > Couldn't such a tool exist outside the standard library. > > I've tried writing such a tool. It would ideally re-use as m

[issue14102] argparse: add ability to create a man page

2018-06-14 Thread Pavel Raiskup
Change by Pavel Raiskup : -- nosy: +Pavel Raiskup ___ Python tracker <https://bugs.python.org/issue14102> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32919] csv.reader() to support QUOTE_ALL

2018-03-05 Thread Pavel Shpilev
Pavel Shpilev <p.shpi...@gmail.com> added the comment: I know that CSV specification says empty field and empty string are the same, however, I still believe there is practical use for unconventional processing of such fields. In our specific case we parse CSVs produced by Amazon

[issue32919] csv.reader() to support QUOTE_ALL

2018-02-22 Thread Pavel Shpilev
New submission from Pavel Shpilev <p.shpi...@gmail.com>: It appears that in current implementation csv.QUOTE_ALL has no effect on csv. reader(), it only affects csv.writer(). I know that csv is a poorly defined format and all, but I think this might be useful to distinguish None and ''

[issue30937] csv module examples miss newline='' when opening files

2017-07-15 Thread Pavel
New submission from Pavel: At the very beginning the csv module documentation (https://docs.python.org/3.7/library/csv.html) advises to open files passing newline='' parameter though three examples don't include it: Here are the examples: 1: >>> import csv >>> wi

urllib.request with proxy and HTTPS

2017-06-30 Thread Pavel Volkov
Hello, I'm trying to make an HTTPS request with urllib. OS: Gentoo Python: 3.6.1 openssl: 1.0.2l This is my test code: = CODE BLOCK BEGIN = import ssl import urllib.request from lxml import etree PROXY = 'proxy.vpn.local:' URL = "https://google.com; proxy =

[issue29160] pow with three int arguments works like it had two arguments

2017-01-04 Thread Pavel Chuvakhov
Pavel Chuvakhov added the comment: Sorry about script, n1 should be n, and n2 should be m. Updated script is attached. Ofc mpz is a way out. One also could cast int( np.int32 ) explicitly. I just wanted to underline that the best way is to hide all this stuff from a user and not make

[issue29160] `pow` with three int arguments works like it had two arguments

2017-01-04 Thread Pavel Chuvakhov
New submission from Pavel Chuvakhov: Standard `pow` function of three integer arguments should result in a reminder `(x**y) % z`. It seems that `pow(x,y,z)` ignores `%z` operation if type(z) is not `int`. This happens also in the cases when `z` has type numpy.int32, numpy.int64, etc. I

Re: Announcement: PythonQL - An integrated query language for Python

2016-11-01 Thread Pavel Velikhov
On Tuesday, 1 November 2016 20:09:14 UTC+3, Peter Otten wrote: > Pavel Velikhov wrote: > > > On Tuesday, 1 November 2016 12:50:37 UTC+3, Peter Otten wrote: > >> Pavel Velikhov wrote: > >> > >> > We have released PythonQL, a query language extension to

Re: Announcement: PythonQL - An integrated query language for Python

2016-11-01 Thread Pavel Velikhov
On Tuesday, 1 November 2016 20:16:43 UTC+3, Michael Torrie wrote: > On 11/01/2016 02:56 AM, Pavel Velikhov wrote: > > Hi Folks, > > > > We have released PythonQL, a query language extension to Python (we > > have extended Python’s comprehensions with a full-fledged

Re: Announcement: PythonQL - An integrated query language for Python

2016-11-01 Thread Pavel Velikhov
On Tuesday, 1 November 2016 12:50:37 UTC+3, Peter Otten wrote: > Pavel Velikhov wrote: > > > We have released PythonQL, a query language extension to Python (we have > > extended Python’s comprehensions with a full-fledged query language, > > drawing from the useful

Announcement: PythonQL - An integrated query language for Python

2016-11-01 Thread Pavel Velikhov
Hi Folks, We have released PythonQL, a query language extension to Python (we have extended Python’s comprehensions with a full-fledged query language, drawing from the useful features of SQL, XQuery and JSONiq). Take a look at the project here: http://www.pythonql.org and lets us know what

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2016-10-24 Thread Pavel Savchenko
Pavel Savchenko added the comment: An implementation of this exists in pytest-mock. Recently an idea was brought up to shift the development of PR #57 into mock directly for everyone's benefit. https://github.com/pytest-dev/pytest-mock https://github.com/pytest-dev/pytest-mock/pull/58

[issue28486] Wrong end index and subgroup for group match

2016-10-20 Thread Pavel Cisar
Changes by Pavel Cisar <cisarpa...@gmail.com>: -- versions: +Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28486> ___

[issue28486] Wrong end index and subgroup for group match

2016-10-20 Thread Pavel Cisar
New submission from Pavel Cisar: Hi, python re returns wrong end index of searched group and also subgroup itself. Example: In: price_string = u"1 307 000,00 Kč" In: match = re.search(r"([,\.]00)\s?.*$", price_string) In: print price_string, "|", matc

Python grammar extension via encoding (pyxl style) questions

2016-09-29 Thread Pavel Velikhov
and especially in Jupyter notebooks. Would you have any advise on how to approach these? Thanks in advance! Pavel Velikhov P.S. Here's the demo site for our project,if you're interested: www.pythonql.org -- https://mail.python.org/mailman/listinfo/python-list

Re: C Python extension to export an Function

2016-09-01 Thread Pavel S
If you're familiar with C++, I recommend to have a look at Boost::Python. Sample program: #include #include void world() { std::cout << "hello world" << std::endl; } BOOST_PYTHON_MODULE( hello ) { using namespace ::boost::python; def( "world", ); } Usage: python -c "import

PyFormat v0.1.0 released (exposing C++ boost::format class)

2016-08-23 Thread Pavel S
Hi all, I'm pleased to announce initial release of PyFormat - C++ module which exposes robust boost::format class from Boost.org C++ libraries. The module supports Python 2.x and Python 3.x versions, bytestrings and unicode strings as well. The API exposes most of functions provided by

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-22 Thread Pavel Belikov
New submission from Pavel Belikov: To demonstrate the capabilities of our analyzer, we regularly perform analysis of open source projects. We had recently checked the CPython project. Here is the link to the article about it: http://www.viva64.com/en/b/0414/ Official page of the analyzer: http

Re: __all__ attribute: bug and proposal

2016-06-27 Thread Pavel S
> but what about integers or strings? Can you provide example? --- No matter if __all__ uses names or objects, I think it should be validated not only when importing '*', but always. Frankly, do you always unit-test if __all__ works? -- https://mail.python.org/mailman/listinfo/python-list

__all__ attribute: bug and proposal

2016-06-27 Thread Pavel S
Hi, I today uncovered subtle bug and would like to share it with you. By a mistake, I forgot to put comma into '__all__' tuple of some module. Notice missing comma after 'B'. # module foo.py __all__ = ( 'A', 'B' 'C', ) class A: pass class B: pass class C: pass If you try to import

Re: mod_python compilation error in VS 2008 for py2.7.1

2016-06-14 Thread Pavel S
Have you considered to use rather WSGI-based solution? (for Apache Httpd is mod_wsgi). Mod_python is totally obsolete. -- https://mail.python.org/mailman/listinfo/python-list

Re: errorhandler 2.0.0 Released!

2016-06-06 Thread Pavel S
Hi, can you explain, why is the attribute 'fired' class-level and not instance-level? There must be good reason for modifying class attribute from instance. Dne pondělí 6. června 2016 15:26:08 UTC+2 Chris Withers napsal(a): > Hi All, > > errorhandler is a tiny but useful logging handler for

Caching function results

2016-03-03 Thread Pavel Volkov
Suppose, I have some resource-intensive tasks implemented as functions in Python. Those are called repeatedly in my program. It's guranteed that a call with the same arguments always produces the same return value. I want to cache the arguments and return values and in case of repititive call

Re: anyone tell me why my program will not run?

2015-11-21 Thread Pavel Volkov
On суббота, 21 ноября 2015 г. 6:30:02 MSK, Dylan Riley wrote: Also some more notes: heads = int("1") tails = int("2") Why use this strange initialization? The usual way: heads = 1 tails = 2 gives the same result. while flips != 0: flips -= 1 There's no need to use while and flips

Re: anyone tell me why my program will not run?

2015-11-21 Thread Pavel Volkov
On суббота, 21 ноября 2015 г. 6:30:02 MSK, Dylan Riley wrote: i am learning python and was tasked with making a program that flips a coin 100 times and then tells you the number of heads and tails. First, you have a syntax error: if result = heads: should be: if result == heads: Second,

[issue25403] urllib.parse.urljoin is broken in python 3.5

2015-10-14 Thread Pavel Ivanov
New submission from Pavel Ivanov: urllib.parse.urljoin does not conform the RFC 1808 in case of joining relative URL’s containing ‘..’ path components anymore. Examples: Python 3.4: >>> urllib.parse.urljoin('http://a.com', '..') 'http://a.com/..' Python 3.5: >>> urllib.p

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-10 Thread Pavel Roskin
Pavel Roskin added the comment: Thank you for the comments. I was annoyed by py_compile making files with names very similar to the original scripts, names that could not even be recognized by shell patterns in .gitignore unless scripts ending with "c" are banned. But th

[issue25303] Add option to py_compile to compile for syntax checking without writing bytecode

2015-10-09 Thread Pavel Roskin
Pavel Roskin added the comment: That's what I have now: check: $(PYTHON) -m py_compile $(SOURCES) rm -f $(addsuffix c, $(SOURCES)) make check python -m py_compile redacted-build redacted-git-diff redacted-git-gc redacted-git-status redacted-init redacted-server

[issue25303] py_compile disregards PYTHONDONTWRITEBYTECODE and -B

2015-10-02 Thread Pavel Roskin
New submission from Pavel Roskin: $ echo "'''Simple script'''" >simple-script $ PYTHONDONTWRITEBYTECODE=1 python3 -B -m py_compile simple-script $ ls __pycache__ simple-scriptcpython-35.pyc py_compile should recognize when the user doesn't want the bytecode to be produced. Ot

Re: Successfully send sms with python

2015-09-23 Thread Pavel S
I don't understand why all of you are telling him about '\r\n\, write(),..' instead of recommending to use take library which already has all problems resolved (python-gammu / wammu). When one will write custom templating stuff, you would also recommend him to take jinja. --

Re: Successfully send sms with python

2015-09-22 Thread Pavel S
On Tuesday, September 22, 2015 at 1:20:07 PM UTC+2, Timon Rhynix wrote: > Hello, I have used pyserial, sms0.4 and other libraries to send sms via > huawei E1750 modem. > The code runs well and no error is thrown but the text message is not > sent/delivered to the number. > One of my code is as

GOTCHA with list comprehension

2015-08-05 Thread Pavel S
Hi, I recently found interesting GOTCHA while doing list comprehension in python 2.6: values = ( True, False, 1, 2, 3, None ) [ value for value in values if value if not None ] [True, 1, 2, 3] I was wondering why this list comprehension returns incorrect results and finally found a typo in

Re: GOTCHA with list comprehension

2015-08-05 Thread Pavel S
)+ [,]] old_expression ::= or_test | old_lambda_expr list_iter ::= list_for | list_if list_if ::= if old_expression [list_iter] So chaining multiple ifs is fine: [ i for i in range(10) if True if True if True if True ] Dne středa 5. srpna 2015 8:49:20 UTC+2 Pavel S napsal

Re: GOTCHA with list comprehension

2015-08-05 Thread Pavel S
$ cat /etc/redhat-release Red Hat Enterprise Linux Server release 6.5 (Santiago) $ python --version Python 2.6.6 Incidentally, why Python 2.6? ChrisA -- https://mail.python.org/mailman/listinfo/python-list

Re: GOTCHA with list comprehension

2015-08-05 Thread Pavel S
Hi Chris, yeah, I have to stick on the software which my employer provides to me (we're enterprise company). I'm not root on that system. I'm happy with 2.6 now, two years ago we were on older RHEL with python 2.4 and it was a real pain :) $ cat /etc/redhat-release Red Hat Enterprise Linux

We're looking for a middle python developer in Moscow

2015-07-21 Thread pavel
Hello everybody! We're looking for a well-experienced python developer who'd like to participate in educational startup in Moscow, Russia. It's going to be a contractor's job position for 6 months with possible prolongation. Here is the link: http://edumate.ru Main milestones for work

[issue23766] json.dumps: solidus (/) should be escaped

2015-03-24 Thread Pavel Strashkin
New submission from Pavel Strashkin: According to http://www.json.org/ and https://tools.ietf.org/html/rfc7159#section-7, the solidus (/) should be escaped (\/) and currently it's not. -- messages: 239170 nosy: xaka priority: normal severity: normal status: open title: json.dumps

[issue16786] argparse doesn't offer localization interface for version action

2015-02-20 Thread Pavel Roskin
Pavel Roskin added the comment: I have tested the patch. It fixes the problem for me. You are right, new programs would just supply translated help to the version action. No effort would be saved. But the programs updated from the deprecated syntax may rely on a separate string list

[issue4431] Distutils MSVC doesn't create manifest file

2015-01-07 Thread Pavel Repin
Changes by Pavel Repin prepin+pythonb...@gmail.com: -- nosy: -paxan ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4431 ___ ___ Python-bugs-list

Using map()

2014-11-16 Thread Pavel Volkov
I checked my modules with pylint and saw the following warning: W: 25,29: Used builtin function 'map' (bad-builtin) Why is the use of map() discouraged? It' such a useful thing. -- https://mail.python.org/mailman/listinfo/python-list

[issue21930] new assert raises syntax proposal

2014-07-07 Thread Pavel Tyslyatsky
New submission from Pavel Tyslyatsky: This proposal look preaty close to pep-463: http://legacy.python.org/dev/peps/pep-0463/, but in assertion context. Now python test libraries have different aproach for assertions, some try use own implementations, for example, for equality `assertEqual

[issue21930] new assert raises syntax proposal

2014-07-07 Thread Pavel Tyslyatsky
Pavel Tyslyatsky added the comment: Thanks for reply, I really missed many cases. I will try look deeper. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21930

[issue21650] add json.tool option to avoid alphabetic sort of fields

2014-06-06 Thread Pavel Kazlou
Pavel Kazlou added the comment: The idea is to keep the same order as in input. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21650

[issue21650] add json.tool option to avoid alphabetic sort of fields

2014-06-03 Thread Pavel Kazlou
New submission from Pavel Kazlou: Currently when you use json.tool, fields are reordered alphabetically. In source code the value of sort_keys is hardcoded to be true. It should be easy to expose this option as command line parameter. -- components: Library (Lib) messages: 219675 nosy

[issue21650] add json.tool option to avoid alphabetic sort of fields

2014-06-03 Thread Pavel Kazlou
Pavel Kazlou added the comment: This is the line in module I'm talking about: json.dump(obj, outfile, sort_keys=True, indent=4) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue21650

[issue5575] Add env vars for controlling building sqlite, hashlib and ssl

2014-05-20 Thread Pavel Machyniak
Pavel Machyniak added the comment: Unfortunately this patch will not work if there is other (system) openssl installed in the default locations (`/usr/include`, `/usr/lib`) because this patch only add another path at the end of the search list. Instead of this I will make a ticket

[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2014-05-20 Thread Pavel Machyniak
New submission from Pavel Machyniak: There is no easy way to build python with custom openssl build. This can lead to miscellaneous problems (like segmentation faults) in various situations/configurations (see eg. http://stackoverflow.com/questions/22409092/coredump-when-compiling-python

[issue21541] Provide configure option --with-ssl for compilation with custom openssl

2014-05-20 Thread Pavel Machyniak
Pavel Machyniak added the comment: This is the proposed patch (compared 2 trees src upd where src is latest release 3.4.1, upd is my working). Changes are in: configure, setup.py. Please review it and hopefully integrate to future releases. -- keywords: +patch versions: +Python 3.4

[issue14710] pkgutil.get_loader is broken

2014-05-19 Thread Pavel Aslanov
Pavel Aslanov added the comment: This function is broken again in version 3.4 The way it should look is: Python 2.7.6 (default, Feb 26 2014, 12:07:17) [GCC 4.8.2 20140206 (prerelease)] on linux2 Type help, copyright, credits or license for more information. import pkgutil pkgutil.get_loader

object().__dict__

2014-04-22 Thread Pavel Volkov
There are some basics about Python objects I don't understand. Consider this snippet: class X: pass ... x = X() dir(x) ['__class__', '__delattr__', '__dict__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__le__', '__lt__',

[issue20740] Remove invalid number from squares in introduction section

2014-02-25 Thread Pavel Kazakov
Pavel Kazakov added the comment: (Alternatively, we could redefine squares in Python. All other languages just have the regular squares; Python has a super *extra* square 2! That clearly makes squares in Python *better* than squares in other languages...) Heh. I initially wasn't sure

[issue20740] Remove invalid number from squares in introduction section

2014-02-22 Thread Pavel Kazakov
New submission from Pavel Kazakov: This is probably being nitpicky, but in the introduction section, the squares list include a 2: squares = [1, 2, 4, 9, 16, 25] However, 2 is not a square number (perfect square). So it should be: [1, 4, 9, 16, 25] I've included a patch that removes the 2

  1   2   >