[issue26698] Tk DPI awareness
Westley Martínez added the comment: IDLE 3.5.1 on Windows 10 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26698> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18844] allow weights in random.choice
Westley Martínez added the comment: I still like Serhiy's implementation more. A function that returns a list instead of the item is unnatural and doesn't fit with the rest of the module. I think there's need to be some discussion about use cases. What do users actually want? Maybe post this on the ideas list. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18844> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26698] IDLE DPI Awareness
New submission from Westley Martínez: IDLE is blurry on High DPI Windows, because IDLE is not DPI aware. IDLE should be made to be DPI aware so that the text is more readable. -- components: IDLE, Library (Lib), Tkinter messages: 262930 nosy: westley.martinez priority: normal severity: normal status: open title: IDLE DPI Awareness type: enhancement versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26698> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17390] display python version on idle title bar
Westley Martínez added the comment: I second that the title should start with the filename, by default. This seems to be the precedent, and it makes it easy when working with multiple files. Example: xxx.py - IDLE x.y.z: C:\mydir\xxx.py Terry, I think we can generalize this as 'important/useful title - general: specific' and apply it to all windows. The first element essentially guarantees that the title name will be a good one for the taskbar. We can apply this to say the FIF output window: Matches for hello - IDLE x.y.z: C:\output.txt but maybe everything after the hyphen isn't necessary. I wonder if long titles could be annoying or distracting. Regardless, anything more specific than 'Output Window' will be better. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7676] IDLE shell shouldn't use TABs
Westley Martínez added the comment: I think the prompt should be in margins, completely separate from the input. It is just meant to be a guide anyway, and make this would make it easy to copy code from the interactive shell to a file. I think output should be in a separate window or frame altogether. I see no reason for keeping it tied with the input. -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7676 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1617161] Instance methods compare equal when their self's are equal
Westley Martínez added the comment: I updated the tests to be in sync, but the implementation of the fix is not so trivial. The conversion from cmp() to rich comparison is the primary culprit, so it will take time for me to get familiar enough with the C source to update the fix. I couldn't seem to get the patch to apply even to the 2.x branch (I think it's because it's an SVN patch...) to see if the fix actually works. That said, this enhancement is so old that it might not warrant a fix at all. Maybe it should be brought up on python-dev? -- Added file: http://bugs.python.org/file34367/1617161_test_update.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1617161 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18410] IDLE Improvements: Unit test for SearchDialog.py
Westley Martínez added the comment: I've submitted a patch. It's not complete. The global functions for the SearchDialog module don't yet have tests because I'm not sure of what these functions are used for. I'd like for anyone to point me in the right direction for implementing those tests. Then there are two tests for the class's main methods. I assume tests are needed for SearchDialogBase.py as well. Should those be in a separate module? -- keywords: +patch Added file: http://bugs.python.org/file34354/idle_test_searchdialog.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18410 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1617161] Instance methods compare equal when their self's are equal
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1617161 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18410] IDLE Improvements: Unit test for SearchDialog.py
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18410 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20877] test_grammar: assertEquals is deprecated
New submission from Westley Martínez: Use of assertEquals in test_grammar is deprecated. I've included a patch to change it to assertEqual. -- files: test_grammar.deprecation.diff keywords: patch messages: 213001 nosy: westley.martinez priority: normal severity: normal status: open title: test_grammar: assertEquals is deprecated versions: Python 3.4, Python 3.5 Added file: http://bugs.python.org/file34323/test_grammar.deprecation.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20877 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13936] RFE: change bool(datetime.time(0, 0, 0)) to evaluate as True
Westley Martínez added the comment: So is the plan to deprecate this in 3.5 and remove in 3.6? If so, the question is where should the deprecation be thrown? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13936 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Origin of 'self'
Why did C++ use this? I don't really like this. It doesn't sound right. I think it's because I have trouble saying the th sound without getting my mouth full of spit. Thankfully you don't often need to use this in C++ like you do with self in Python. -- https://mail.python.org/mailman/listinfo/python-list
Origin of 'self'
I understand that in an object method the first argument in the object itself, called self. However, it doesn't have to be called self, and can be called anything. So my question is why is it called self and not this like from C++ and Java. It's kind of a silly question, but one that I'm curious about nevertheless. Sincerely, Westley Martínez -- https://mail.python.org/mailman/listinfo/python-list
[issue12387] IDLE save keyboard shortcut problem
Westley Martínez added the comment: I know that Tk has individual states for whether or not a key is pressed with Caps Lock or Shift or other modifiers, so maybe there is a way to have the shortcuts ignore Caps Lock entirely. More info: http://stackoverflow.com/questions/665502/status-of-shift-and-caps-lock-in-python -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue12387 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20580] IDLE should support platform-specific default config defaults
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20580 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10747] Include version info in Windows shortcuts
Westley Martínez added the comment: I understand this is an old issue. Sorry if it is no longer relevant. I have usually have at least two versions of Python installed on Windows: 2.x and 3.x. In Windows 7, if you pin a certain shortcut to the start menu, you can't tell what version of Python is for. I'd like that to be changed. Nick's format looks good. -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10747 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17390] display python version on idle title bar
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11122] bdist_rpm should use rpmbuild, not rpm
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11122 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue17390] display python version on idle title bar
Westley Martínez added the comment: How about adding an optional argument to OutputWindow that specifies the title for the window? Or would this be more suitable for EditorWindow (which OutputWindow inherits from)? Either way, doing this would allow any OutputWindow to specify its own title. The current title Output, is pretty useless. I've written a patch that adds the functionality. In addition, I changed the title of the Find in Files output window to what you imagined. -- Added file: http://bugs.python.org/file34239/issue17390.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue17390 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue1100942] Add datetime.time.strptime and datetime.date.strptime
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1100942 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20265] Bring Doc/using/windows up to date
Westley Martínez added the comment: I personally like this page about environment variables: http://www.computerhope.com/issues/ch000549.htm It is clear, concise, and has pretty pictures. However, it does not address Windows 8. Since Windows 8 is becoming more popular everyday, and since it is rather odd and difficult to configure, we should update the article to include stuff for Windows 8. Unfortunately, I don't have Windows 8, so I can't help there. -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20265 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20402] List comprehensions should be noted in for loop documentation
Westley Martínez added the comment: I'm curious what the best way to do this would be. Obviously the simplest would just be 'See also list comprehensions.' However since this is a tutorial, I was thinking of adding something like this: 'In other languages, for loops are often used to fill a sequence with data. While this method works just as well in Python, it is often better to use a list comprehension' and then there could be an example like that found here: http://docs.python.org/2/tutorial/datastructures.html#list-comprehensions Followed by a link to more info on list comprehensions. -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20402 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20146] UserDict module docs link is obsolete
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +westley.martinez ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20146 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18840] Tutorial recommends pickle module without any warning of insecurity
Westley Martínez added the comment: Sounds good to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18840 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11176] give more meaningful argument names in argparse documentation
Westley Martínez added the comment: I've skimmed through the patches. Good job kids. This is much better than it was before. No more of that silly command-line calculator or the foobar nonsense that sounds drier than the POSIX standard. Is there anything else that needs to be done? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11176 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: reload and work flow suggestions
On Saturday, September 21, 2013 2:43:13 PM UTC-7, Peter Cacioppi wrote: This is an idea brought over from another post. When I write Python code I generally have 2 or 3 windows open simultaneously. 1) An editor for the actual code. 2) The interactive interpreter. 3) An editor for the unit tests. (Sometimes skipped for quick one-off scripts) My work flow tends to involve using 2 to debug the issues that come up with 1 and 3. I'll write some new code in 1, play around with it in 2, then solidify the tests in 3. Or a test in 3 fails and I dig around with it using 2. My problem is that I tend to use reload() quite a bit. I want to call functions and construct objects that are inside the guts of 1 and pass them arguments that are stored as variables in 2. If I restart my session for 2 I lose these variables (iPython does mitigate the pain here somewhat). Hence, I reload() modules into 2 when they are changed. I use ipdb a lot in 2. I usually don't feel comfortable with virgin code or a debug fix that hasn't been stepped through with the debugger. Is there something wrong with this work flow? I understand most python experts avoid reload(). So what are they doing that I'm not? I love the ability of Python to quickly let you dive deep into your code and set up a difficult case with 2, it's hard to imagine giving this up, and it's hard to imagine using it without reload(). Thanks for any tips. In short, there's nothing wrong with any workflow so long as it works. -- https://mail.python.org/mailman/listinfo/python-list
[issue18844] allow weights in random.choice
Westley Martínez added the comment: I think Storchaka's solution is more transparent and I agree with him on the point that the choice generator should be exposed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18844 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: better and user friendly IDE recommended?
On Wednesday, September 11, 2013 7:14:04 AM UTC-7, mnishpsyched wrote: Hey i am a programmer but new to python. Can anyone guide me in knowing which is a better IDE used to develop web related apps that connect to DB using python? I use vim and idle. -- https://mail.python.org/mailman/listinfo/python-list
[issue18903] IDLE file-completion is case-sensitive in Windows
Westley Martínez added the comment: I've written a patch that sort of implements the functionality that makes the most sense to me. The problem is it only works right for the first entry. It's kind of wonky and I'm not entirely sure how it behaves, nor do I know the cause of the bug, but it's a start. -- keywords: +patch Added file: http://bugs.python.org/file31710/cpython-idle-18903-1.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18903 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Building tkinter on Windows
On Monday, September 9, 2013 12:43:16 AM UTC-7, Terry Reedy wrote: Some combination of the README instructions, external.bat, and the project files are not correct. There may be an issue on the tracker. I believe I copied tcl85g.dll and tk85g.dll into .../py3x/pcbuild from .../tcltk/bin and that resolved the problem for me. But you say you did that. Did _tkinter_d.pyd get built (in pcbuild)? Well, after doing a clean clone and rebuilding everything it worked. I'm not sure what the issue was, but something must've went wrong the first time. I see you've opened an issue about this. I think the README definitely needs to be updated. It's not very user friendly and is somewhat ambiguous. Also, I think the dev guide could be improved as well. I think Windows users (actually, I'm more of Linux user, but whatever) tend to get the short end of the stick in a lot of open-source projects. I think that's a trend that needs to change. -- https://mail.python.org/mailman/listinfo/python-list
Building tkinter on Windows
Hello. Can anyone tell me how to build tkinter on Windows? I've downloaded the source, ran Tools/buildbot/external.bat to build the external dependencies. I copied tcl85g.dll and tk85g.dll to PCBuild. I built the Visual Studio solution. Everything built fine without errors. Everything seems to work except tkinter. It says: Traceback (most recent call last): File stdin, line 1, in module File ...\cpython-idle\lib\tkinter\__init__.py, line 36, in module from tkinter import _fix File ...\cpython-idle\lib\tkinter\_fix.py, line 65, in module import _tkinter ImportError: DLL load failed: The specified module could not be found. I'm thinking I didn't put the DLLs in the right place, but I don't have any idea where to put them and Google isn't helping. -- https://mail.python.org/mailman/listinfo/python-list
[issue18903] IDLE file-completion is case-sensitive in Windows
Westley Martínez added the comment: My example was totally abstract and untested. Sorry for any confusion. After doing some research, I find that this issue is complicated further: http://support.microsoft.com/kb/100625 I think we can assume that running into a situation where there are identical filenames except for case is quite rare. The thing is, I don't even know how to make files like this on Windows. Explorer doesn't work, and other Win32 apps won't do it (they all spit up errors). I reckon I can do it with Python or some other language, since I assume they does these things at a low level. I'll start looking at the code and see if I can come up with a patch. My aim is to make it similar enough to how the Windows Terminal does it, (i.e. it corrects the typed name to the proper case) since that is what I'd imagine most Windows programmers are used to. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18903 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18903] IDLE file-completion is case-sensitive in Windows
Westley Martínez added the comment: I believe HFS is case-preserving as well, but it also can be configured to be case-sensitive. I'm not a Mac owner though so don't take my word for it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18903 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18844] allow weights in random.choice
Westley Martínez added the comment: Honestly, I think adding weights to any of the random functions are trivial enough to implement as is. Just because something becomes a common task does not mean it ought to be added to the stdlib. Anyway, from a user point of view, I think it'd be useful to be able to send a sequence to a function that'll weight the sequence for use by random. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18844 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18903] IDLE file-completion is case-sensitive in Windows
New submission from Westley Martínez: Hi, I'm not sure if this would be considered a bug or a feature request, but IDLE's file-completion is case-sensitive in Windows (e.g. if I have a file named ABBA and I type in 'abb' + tab, ABBA won't pop up. Since Windows files systems are not case-sensitive, it might make sense for the file-completion to disregard case as well. I'm not sure if this behaviour is preferred, however, so I'll leave that up for discussion. I tested the behaviour on 3.3 and 3.4; I assume it's the same for other versions as well. -- components: IDLE, Windows messages: 196765 nosy: anikom15 priority: normal severity: normal status: open title: IDLE file-completion is case-sensitive in Windows type: enhancement versions: Python 3.3, Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18903 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18844] allow weights in random.choice
Changes by Westley Martínez aniko...@gmail.com: -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18844 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13951] Document that Seg Fault in .so called by ctypes causes the interpreter to Seg Fault
Westley Martínez added the comment: Can we have this committed? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez added the comment: On Thu, Oct 11, 2012 at 3:06 PM, Terry J. Reedy rep...@bugs.python.org wrote: Terry J. Reedy added the comment: This patch (I suspect it is this one) disabled the use of '/' in filenames on windows when using filename completion. 'c:\ wait, tab, ^space bring up box in 3.2.3 and 3.3.0 (If there is no 'r' prefix, it really should require '\\' to be safe.) +1 for requiring \\. I'll test this tomorrow and report back the behaviour. On Linux it seems that the window only pops up when you press tab. I think behaviour should be as identical on all platforms as possible. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14974] rename packaging.pypi to packaging.index
Westley Martínez added the comment: I think I like the term catalog myself, but I'm not wholly opposed to index. I think it is certainly better than pypi. Although the namespace does reduce the genericness of index, a lot of programmers (including me) like to use the from namespace import x method. I think that's considerable. That said, programmers could use from packaging import index as pindex or some sort to alleviate this. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18840] Tutorial recommends pickle module without any warning of insecurity
Westley Martínez added the comment: How about we simply add the warning from http://docs.python.org/3/library/pickle.html#module-pickle to the beginning (or end) of the section? The Official Python Tutorial has always assumed a certain programmer's competence. It's up to them if they want to use the module or not. -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18840 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez added the comment: On 3.4.0a1 on Windows it seems to come up automatically with \ or \\. A single \ will only pop up with the tab key; I think it's good that way. Special characters (i.e. æ) work normally. All this said, I think this issue is fixed. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18840] Tutorial recommends pickle module without any warning of insecurity
Westley Martínez added the comment: I won't question the usefulness of JSON. I'm not a web programmer and have never used it. From my interpretation of the tutorial, it seems that the section's purpose is for storing python objects. If pickle is going to stay in the tutorial, I think a warning is imperative. Either way, I think a section on JSON would be a welcome addition to the tutorial. +1 adding a warning +0 keeping pickle in the tutorial -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18840 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18840] Tutorial recommends pickle module without any warning of insecurity
Westley Martínez added the comment: Here's a patch that adds the warning, if we so choose to keep pickle in the tutorial. It's taken verbatim from the pickle module's documentation. -- keywords: +patch Added file: http://bugs.python.org/file31524/pickle-add-warning_18840.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue18840 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: New to python, do I need an IDE or is vim still good enough?
On Thu, Dec 27, 2012 at 12:01:16PM -0800, mogul wrote: 'Aloha! I'm new to python, got 10-20 years perl and C experience, all gained on unix alike machines hacking happily in vi, and later on in vim. Now it's python, and currently mainly on my kubuntu desktop. Do I really need a real IDE, as the windows guys around me say I do, or will vim, git, make and other standalone tools make it the next 20 years too for me? Oh, by the way, after 7 days I'm completely in love with this python thing. I should have made the switch much earlier! /mogul %-) I only use vim for everything. IDEs just seem to get in my way. -- http://mail.python.org/mailman/listinfo/python-list
Re: pygnomevfs get_local_path_from_uri replacement
On Sat, Dec 22, 2012 at 09:57:11AM +0100, Daniel Fetchinson wrote: Hi folks, I realize this is slightly off topic and maybe belongs to a gnome email list but it's nevertheless python: I use an old python program that was written for gnome 2 and gtk 2 and uses the function get_local_path_from_uri. More specifically it uses gnomevfs.get_local_path_from_uri. Now with gnome 3 the module pygnomevfs does not exist anymore and after checking the source for pygnomevfs it turns out it's written in C using all the header files and stuff from gnome 2. So I can't just lift it from the source. I was hoping it's pure python in which case I could have simply lifted it. Does anyone know what a good replacement for get_local_path_from_uri is? Is there a gtk/gnome/etc related python package that contains it which would work with gnome 3? Or a totally gnome-independent python implementation? Cheers, Daniel I'd reckon you'd get better info by asking the people at GTK or GNOME. -- http://mail.python.org/mailman/listinfo/python-list
Re: Py 3.3, unicode / upper()
On Wed, Dec 19, 2012 at 02:23:15PM -0700, Ian Kelly wrote: On Wed, Dec 19, 2012 at 1:55 PM, wxjmfa...@gmail.com wrote: If wrong, this can be considered as programmatically correct or logically acceptable (Py3.2) 'Straße'.upper().lower().capitalize() == 'Straße' True while this will *always* be problematic (Py3.3) 'Straße'.upper().lower().capitalize() == 'Straße' False On the other hand (Py3.2): 'Straße'.upper().isupper() False vs. Py3.3: 'Straße'.upper().isupper() True There is probably no one clearly correct way to handle the problem, but personally this contradiction bothers me more than the example that you posted. Why would it ever be wrong for 'Straße' to not equal 'Strasse'? Python is not intended to do any sort of advanced linguistic processing. It is comparing strings not words. It is not problematic. It makes sense. -- http://mail.python.org/mailman/listinfo/python-list
Re: Py 3.3, unicode / upper()
On Wed, Dec 19, 2012 at 09:54:20PM -0500, Terry Reedy wrote: On 12/19/2012 9:03 PM, Chris Angelico wrote: On Thu, Dec 20, 2012 at 5:27 AM, Ian Kelly ian.g.ke...@gmail.com wrote: From what I've been able to discern, [jmf's] actual complaint about PEP 393 stems from misguided moral concerns. With PEP-393, strings that can be fully represented in Latin-1 can be stored in half the space (ignoring fixed overhead) compared to strings containing at least one non-Latin-1 character. jmf thinks this optimization is unfair to non-English users and immoral; he wants Latin-1 strings to be treated exactly like non-Latin-1 strings (I don't think he actually cares about non-BMP strings at all; if narrow-build Unicode is good enough for him, then it must be good enough for everybody). Not entirely; most of his complaints are based on performance (speed and/or memory) of 3.3 compared to a narrow build of 3.2, using silly edge cases to prove how much worse 3.3 is, while utterly ignoring the fact that, in those self-same edge cases, 3.2 is buggy. And the fact that stringbench.py is overall about as fast with 3.3 as with 3.2 *on the same Windows 7 machine* (which uses narrow build in 3.2), and that unicode operations are not far from bytes operations when the same thing can be done with both. -- Terry Jan Reedy Really, why should we be so obsessed with speed anyways? Isn't improving the language and fixing bugs far more important? -- http://mail.python.org/mailman/listinfo/python-list
[issue14974] rename packaging.pypi to packaging.index
Westley Martínez aniko...@gmail.com added the comment: -1 index is too generic to convey any kind of meaning and can be confused--atleast for me--with list.index. Sometimes it is better for a name to be specific. -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14974 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez aniko...@gmail.com added the comment: I think a better technique would be to expand FILENAME_CHARS to include more characters. -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez aniko...@gmail.com added the comment: Also, shouldn't the space character ' ' be included? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez aniko...@gmail.com added the comment: Ahh okay, sorry for the triple post, I have an idea. On UNIX, the function should accept any character except: \0 /, and on Windows should accept any character except: \0 \ / : * ?| On classic Macintosh, : is invalid. However, I do not know what characters are valid on other systems. (I believe Mac OS X is the same as UNIX, but am not sure.) Included is a patch with FILENAME_CHARS left in in case anything still needs it. -- Added file: http://bugs.python.org/file25802/cpython-14937.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14937] IDLE's deficiency in the completion of file names (Python 32, Windows XP)
Westley Martínez aniko...@gmail.com added the comment: You're right. The code shouldn't *have* to check if the name is valid. It should just accept that the name is already valid. This would simplify things. Here's the problem: the code needs to find the index of where the string with the filename starts. The way the code does it now by checking for a quote in a rather obfuscated way (while i and curline[i-1] in FILENAME_CHARS + SEPS:). So, changing that line to say curline[i-1] != ' or curline[i-1] != '' would work (in theory) but I'm really hoping there's a better way. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14937 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14972] listcomp with nested classes
Westley Martínez aniko...@gmail.com added the comment: $ python Python 3.2.3 (default, Apr 23 2012, 23:35:30) [GCC 4.7.0 20120414 (prerelease)] on linux2 Type help, copyright, credits or license for more information. class A: ... x = 42 ... y = [x for _ in '1'] ... Traceback (most recent call last): File stdin, line 1, in module File stdin, line 3, in A File stdin, line 3, in listcomp NameError: global name 'x' is not defined x = 42 class A: ... x = 12 ... y = [x for _ in '1'] ... A.y [42] It seems that the list comprehension is looking at the module's scope as opposed to the class scope. This definitely seems incorrect to me. -- nosy: +anikom15 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14972 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: are int, float, long, double, side-effects of computer engineering?
On Tue, Mar 06, 2012 at 04:29:10PM -0500, Calvin Kim wrote: On 03/06/2012 01:34 AM, Xah Lee wrote: while what you said is true, but the problem is that 99.99% of programers do NOT know this. They do not know Mathematica. They've never seen a language with such feature. The concept is alien. This is what i'd like to point out and spread awareness. I can see your point. But that's not simply true. In my case and many others, such issue was addressed during first week of introductory programming classes. I was naively thought computer = precision and I was stunned to find out the inaccuracy of computer calculations. But as you experienced, I also stumble upon some people (specially Java only programmers) who were not aware of it. also, argument about raw speed and fine control vs automatic management, rots with time. Happened with auto memory management, managed code, compilers, auto type conversion, auto extension of array, auto type system, dynamic/scripting languages, etc. Maybe it's because I'm not in scientific community, that I learned to live with such side-effects. Because 99.99% of computer users and programmers can afford to, and willing to lose such small inaccuracy billion times in exchange for some performance increase and convenience. Although NASA may not accept my application for their projects for Mars mission after this posting. Also remember that double precision is not the maximum. There exist standards for triple and quadruple precision formats, as well as other extended formats. -- http://mail.python.org/mailman/listinfo/python-list
Re: are int, float, long, double, side-effects of computer engineering?
On Mon, Mar 05, 2012 at 05:11:09PM -0800, Xah Lee wrote: some additional info i thought is relevant. are int, float, long, double, side-effects of computer engineering? Xah Lee wrote: «… One easy way to measure it is whether a programer can read and understand a program without having to delve into its idiosyncrasies. …» Chris Angelico wrote: «Neither the behavior of ints nor the behavior of IEEE floating point is a quirk or an idiosyncracy. …» they are computer engineering by-products. Are quirks and idiosyncracies. Check out a advanced lang such as Mathematica. There, one can learn how the mathematical concept of integer or real number are implemented in a computer language, without lots by-products of comp engineering as in vast majority of langs (all those that chalks up to some IEEE. (which, sadly, includes C, C++, perl, python, lisp, and almost all. (Common/Scheme lisp idiots speak of the jargon “number tower” instead I.) (part of the reason almost all langs stick to some I stuff is because it's kinda standard, and everyone understand it, in the sense that unix RFC (aka really fucking common) is wide-spread because its free yet technically worst. (in a sense, when everybody's stupid, there arise a cost to not be stupid.. A friend asked: «Can you enlighten us as to Mathematica's way of handling numbers, either by a post or a link to suitable documentation? …» what i meant to point out is that Mathematica deals with numbers at a high-level human way. That is, one doesn't think in terms of float, long, int, double. These words are never mentioned. Instead, you have concepts of machine precision, accuracy. The lang automatically handle the translation to hardware, and invoking exact value or infinite precision as required or requested. in most lang's doc, words like int, long, double, float are part of the lang, and it's quick to mention IEEE. Then you have the wide- spread overflow issue in your lang. In M, the programer only need to think in terms of math, i.e. Real number, Integer, complex number, precision, accuracy, etc. this is what i meat that most lang deals with computer engineering by- products, and i wished them to be higher level like M. http://reference.wolfram.com/mathematica/guide/PrecisionAndAccuracyControl.html Try Fortran. -- http://mail.python.org/mailman/listinfo/python-list
Re: How do you use the widgets in tkinter.ttk if you want to import tkinter as tk?
On Sun, Mar 04, 2012 at 05:39:27PM -0800, Rick Johnson wrote: On Mar 2, 11:06 pm, John Salerno johnj...@gmail.com wrote: I'm tempted just to go back to wxPython. Two sets of widgets in Tkinter is a little annoying. Your complaint is justified. The Tkinter API is a disgrace. IDLE's source is just as bad. Luckily i have not made the jump to py3000 full- time yet, but when i do, i think the first item on my to-do list will be to hack this hideous tk+ttk+blah+blah into something more friendly. Heck, maybe i'll even release it! Make sure not to write it from scratch! -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with non-standard tcl/tk support
On Sat, Mar 03, 2012 at 05:36:52PM +, Steven D'Aprano wrote: I'm trying to re-build Python 3.2 with support for TCL/TK 8.5, but when I run make I get this message: Failed to build these modules: _tkinter and after installing 3.2 I still have this: import _tkinter _tkinter.TK_VERSION '8.4' What do I need to do to have Python 3.2 use tcl/tk 8.5? I have installed tcl/tk 8.5.11 from source, and the binaries are here: /usr/local/lib/libtcl8.5.so /usr/local/lib/libtk8.5.so In the Python 3.2 source, I do the usual: ./configure make sudo make altinstall (altinstall to avoid nuking the system Python) That's all you should have to do, but on my system the Tk libraries are in /usr/lib not /usr/local/lib. So try doing ./configure --prefix=/usr/local or try setting LDFLAGS to -L/usr/local/lib. -- http://mail.python.org/mailman/listinfo/python-list
Re: Building Python with non-standard tcl/tk support
On Sun, Mar 04, 2012 at 12:50:53AM +, Steven D'Aprano wrote: Okay, now I'm making progress... if I remove the previously existing _tkinter in lib-dynload, and re-run make, I get something new: building '_tkinter' extension gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall - Wstrict-prototypes -DWITH_APPINIT=1 -I/usr/X11/include -IInclude -I. -I./ Include -I/usr/local/include -I/tmp/Python-3.2.2 -c /tmp/Python-3.2.2/ Modules/_tkinter.c -o build/temp.linux-i686-3.2/tmp/Python-3.2.2/Modules/ _tkinter.o gcc -pthread -fPIC -fno-strict-aliasing -DNDEBUG -g -fwrapv -O3 -Wall - Wstrict-prototypes -DWITH_APPINIT=1 -I/usr/X11/include -IInclude -I. -I./ Include -I/usr/local/include -I/tmp/Python-3.2.2 -c /tmp/Python-3.2.2/ Modules/tkappinit.c -o build/temp.linux-i686-3.2/tmp/Python-3.2.2/Modules/ tkappinit.o gcc -pthread -shared build/temp.linux-i686-3.2/tmp/Python-3.2.2/Modules/ _tkinter.o build/temp.linux-i686-3.2/tmp/Python-3.2.2/Modules/tkappinit.o -L/usr/X11/lib -L/usr/local/lib -ltk8.5 -ltcl8.5 -lX11 -o build/lib.linux- i686-3.2/_tkinter.cpython-32m.so *** WARNING: renaming _tkinter since importing it failed: libtk8.5.so: cannot open shared object file: No such file or directory Failed to build these modules: _tkinter Verify that libtk8.5.so exists in /usr/local/lib and verify you have read permission. You could try to write a Tk C program (or find one) and try building that with cc -L/usr/X11/lib -L/usr/local/lib -ltk8.5 -ltcl8.5 -lX11 . If that works then your Tk libraries are installed properly and something is wonky with your Python build. -- http://mail.python.org/mailman/listinfo/python-list
[issue14185] Failure to build _dbm with ndbm on Arch Linux
New submission from Westley Martínez aniko...@gmail.com: When building Python I get this: building dbm using ndbm *** WARNING: renaming _dbm since importing it failed: build/lib.linux-i686-3.3-pydebug/_dbm.cpython-33dm.so: undefined symbol: dbm_nextkey Failed to build these modules: _dbm I'm running Arch and I have gdbm installed so shouldn't it be building dbm with gdbm? -- messages: 154845 nosy: anikom15 priority: normal severity: normal status: open title: Failure to build _dbm with ndbm on Arch Linux type: compile error versions: Python 3.3 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14185 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13951] Seg Fault in .so called by ctypes causes the interpreter to Seg Fault
Westley Martínez aniko...@gmail.com added the comment: Hi I found this bug randomly and have made two small patches to change the documentation. One assumes that the faulthandler module is available for 3.3. The other patch is for earlier versions of Python. -- keywords: +patch nosy: +anikom15 versions: +Python 3.3 Added file: http://bugs.python.org/file24722/cpython-13951.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13951] Seg Fault in .so called by ctypes causes the interpreter to Seg Fault
Changes by Westley Martínez aniko...@gmail.com: Added file: http://bugs.python.org/file24723/cpython-13951-pre3.3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13951 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue14135] check for locale changes in test.regrtest
Westley Martínez aniko...@gmail.com added the comment: Here's a test that checks for changes to the locale. -- nosy: +anikom15 Added file: http://bugs.python.org/file24724/test_14135.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14135 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: New Science Discovery: Perl Idiots Remain Idiots After A Decade!New Science Discovery: Perl Idiots Remain Idiots After A Decade!
First of all: http://www.youtube.com/watch?v=z5jKMEB4hHE On Wed, Feb 29, 2012 at 12:09:16AM -0800, Xah Lee wrote: Now, let me tell you what operator precedence is. First of all, let's limit ourselfs to discuss operators that are so-called binary operators, which, in our context, basically means single symbol operator that takes it's left and right side as operands. Now, each symbol have a “precedence”, or in other words, the set of operators has a order. (one easy way to think of this is that, suppose you have n symbols, then you give each a number, from 1 to n, as their order) So, when 2 symbols are placed side by side such as 「3 △ 6 ▲ 5」, the symbol with higher precedence wins. Another easy way to think of this is that each operator has a stickiness level. The higher its level, it more sticky it is. You're absolutely correct. the problem with the perl explanations is that it's one misleading confusion ball. It isn't about “left/right associativity”. It isn't about “evaluates from left to right or right to left”. Worse, the word “associativity” is a math term that describe a property of algebra that has nothing to do with operator precedence, yet is easily confused with because it is a property about order of evaluation. (for example, the addition function is associative, meaning: 「(3+6)+5 = 3+(6+5)」.) You're not getting it. Math is a language. Perl is a language. They have different rules for grammar. In Perl, C, Python, Java, and pretty much all procedural-based languages, operations are evaluated in two steps: the precedence /and/ the associativity. Each level of precedence has its own associativity, either left-to-right or right-to-left. You can see this in table 2-1 in The C Programming Language. Whatever math does or what you think math does has nothing to do with the way Perl evaluates expressions. -- http://mail.python.org/mailman/listinfo/python-list
Re: Line continuation issue\
On Fri, Nov 04, 2011 at 11:10:58AM -0400, Steven Lehar wrote: Is this the right place to propose language extensions? My Python code keeps expanding rightwards, it is difficult to keep it contained within reasonable limits. But the standard line continuation \ is positively anti-Pythonic because an *invisible* white space between \ and [CR] will render it useless. How about a new Python symbol, maybe \\ that CAN have following whitespace which is ignored, so that seeing a \\ in the code forces it to continue on the next line. Has this issue been discussed already? slehar Use subroutines. -- http://mail.python.org/mailman/listinfo/python-list
[issue13193] test_packaging and test_distutils failures
Westley Martínez aniko...@gmail.com added the comment: http://www.archlinux.org/download/ It's a minimalist distribution but if you read through the install guide or beginner's guide you'll be fine. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13193 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: compare range objects
On Thu, Oct 20, 2011 at 06:19:40AM -0700, Yingjie Lan wrote: Hi, Is it possible to test if two range objects contain the same sequence of integers by the following algorithm in Python 3.2? 1. standardize the ending bound by letting it be the first excluded integer for the given step size. 2. compare the standardized starting bound, ending bound and step size: two ranges equal if and only if this triplet is the same. If that's correct, it would be good to have equality comparison on two ranges. Further, it might also be good to have sub-sequence test on ranges without enumerating it. There's already a discussion about this on python-ideas. But somebody please tell me, why would you ever need to compare ranges? -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] Re: Benefit and belief
On Thu, Oct 20, 2011 at 06:05:00PM -0400, Prasad, Ramit wrote: I think you need to speak German fluently to be a good programmer. Why? I won't reveal my secrets to JP Morgan Chase! I am loyal to the mighty Bank of America. -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] Re: Benefit and belief
On Wed, Oct 19, 2011 at 09:01:39PM +, Steven D'Aprano wrote: On Wed, 19 Oct 2011 13:15:54 +, Curt wrote: On 2011-10-19, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: On Tue, 18 Oct 2011 14:23:49 +, Curt wrote: Most of us say un et un _font_ deux, in fact, because we know how to conjugate as well as perform simple arithmetic. :-) I blame Google Translate. I thought you were trying to shine as a polyglot(math). I am a poly-illiterate. I can't read or write hundreds of languages. I think you need to speak German fluently to be a good programmer. -- http://mail.python.org/mailman/listinfo/python-list
[issue13230] test_resources fails
New submission from Westley Martínez aniko...@gmail.com: After running the uber test on the latest build of python (./python -bb -E -Wd -m test -r -w -uall) I get one error: == ERROR: test_resources (packaging.tests.test_command_install_data.InstallDataTestCase) -- Traceback (most recent call last): File /home/westley/Projects/cpython/Lib/packaging/tests/test_command_install_data.py, line 134, in test_resources with packaging.database.get_file('Spamlib', 'spamd') as fp: File /home/westley/Projects/cpython/Lib/packaging/database.py, line 649, in get_file return open(get_file_path(distribution_name, relative_path), File /home/westley/Projects/cpython/Lib/packaging/database.py, line 644, in get_file_path raise LookupError('no distribution named %r found' % distribution_name) LookupError: no distribution named 'Spamlib' found -- I also pasted the entire test output (verbose) to the testout file -- components: Library (Lib) files: testout.txt messages: 146006 nosy: anikom15 priority: normal severity: normal status: open title: test_resources fails type: behavior Added file: http://bugs.python.org/file23478/testout.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue13230 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
Re: Equal sets with unequal print and str() representations
On Sun, Oct 16, 2011 at 05:52:03PM -0600, Ganesh Gopalakrishnan wrote: This probably is known, but a potential pitfall (was, for me) nevertheless. I suspect it is due to hash collisions between 's3' and 's13' in this case? It happens only rarely, depending on the contents of the set. S1 = {'s8', 's3', 's2', 's0', 's7', 's6', 's4', 's13', 's14'} S1 = {'s8', 's3', 's2', 's0', 's7', 's6', 's4', 's13', 's14'} S2 = {'s8', 's13', 's2', 's0', 's7', 's6', 's4', 's3', 's14'} S2 = {'s8', 's13', 's2', 's0', 's7', 's6', 's4', 's3', 's14'} S1 S1 {'s8', 's13', 's2', 's0', 's7', 's6', 's4', 's3', 's14'} S2 S2 {'s8', 's3', 's2', 's0', 's7', 's6', 's4', 's13', 's14'} S1==S2 S1==S2 True str(S1) str(S1) {'s8', 's13', 's2', 's0', 's7', 's6', 's4', 's3', 's14'} str(S2) str(S2) {'s8', 's3', 's2', 's0', 's7', 's6', 's4', 's13', 's14'} str(S1) == str(S2) False This is because sets do not preserve order. -- http://mail.python.org/mailman/listinfo/python-list
Re: Can I search a list for a range of values?
On Fri, Oct 14, 2011 at 05:01:04PM -0600, Ian Kelly wrote: On Fri, Oct 14, 2011 at 4:30 PM, Tim Chase python.l...@tim.thechases.com wrote: On 10/14/11 17:20, Chris Angelico wrote: Try a list comprehension: a = [2,4,5,6,3,9,10,34,39,59,20,15,13,14] [i for i in a if i=10 if i=20] [10, 20, 15, 13, 14] The double-if is new to me. I thought it was an error when I first saw it, but it seems to be legit syntax (or at least one that 2.7 tolerates, intentionally or otherwise...). I think I'd make it clearer with either [i for i in a if i=10 and i=20] or even more clearly: [i for i in a if 10 = i = 20] As long as we're nitpicking, I'll point out that i is an inappropriate variable name here, since it is normally used to denote indices, not data. That's why I used x in my response instead. ;-) O that's what i stands for. I always thought it was integer o_O -- http://mail.python.org/mailman/listinfo/python-list
Re: Language Enhancement Idea to help with multi-processing (your opinions please)
On Thu, Oct 13, 2011 at 11:56:20PM -0700, Carl Banks wrote: On Thursday, October 13, 2011 7:16:37 PM UTC-7, Steven D#39;Aprano wrote: What I would expect to happen that all statements within the ooo block may be executed out of order. The block itself waits till all statements are returned before continuing. Why do you think this needs to be a language statement? You can have that functionality *right now*, without waiting for a syntax update, by use of the multiprocessing module, or a third party module. http://docs.python.org/library/multiprocessing.html http://wiki.python.org/moin/ParallelProcessing There's no need for forcing language changes on everyone, whether they need it or not, for features that can easily be implemented as library code. This goes a little beyond a simple threading mechanism, though. It's more like guidance to the compiler that you don't care what order these are executed in; the compiler is then free to take advantage of this advice however it like. That could be to spawn threads, but it could also compile instructions to optimize pipelining and cacheing. The compiler could also ignore it. But you can see that, fully realized, syntax like that can do much more than can be done with library code. Obviously that extra capability is a very long way off for being useful in CPython. While we're at it, let's throw in the register keyword. -- http://mail.python.org/mailman/listinfo/python-list
Re: Opportunity missed by Python ?
On Thu, Oct 13, 2011 at 11:45:06AM +0200, candide wrote: Dart is the very new language created by Google to replace Javascript. So Python was not able to do the job? Or may be they don't know about Python at Google ;) ? Google's a big supporter for Python...I think Guido working being employed there has something to do with it, but I could be conspiring. Python is not an appropriate language for client-side web scripts, it's just too good for such a lowly job. ;) -- http://mail.python.org/mailman/listinfo/python-list
Re: Opportunity missed by Python ?
On Thu, Oct 13, 2011 at 09:07:09PM +1100, Chris Angelico wrote: On Thu, Oct 13, 2011 at 8:45 PM, candide candide@free.invalid wrote: Dart is the very new language created by Google to replace Javascript. So Python was not able to do the job? Or may be they don't know about Python at Google ;) ? Python, as I found out to my detriment, is practically impossible to sandbox effectively. Any language that hopes to gain full traction in a browser-based environment MUST be secure against scripts gaining too much control over the browser chrome. Also, Dart is looking to support (optional) strict typing, which Python doesn't do. That's a fairly major performance enhancement. ChrisA You mean static typing? -- http://mail.python.org/mailman/listinfo/python-list
Re: shipping python
On Tue, Oct 11, 2011 at 05:04:45PM -0600, Kristen J. Webb wrote: I am new to python coming from the C/shell side. We have been experimenting with some code samples and now I'm looking at some command line argument processing. I find getopt older optparse new in 2.3 argparse new in 2.7 I search around on some of my client systems and find lots of people in the 2.4 - 2.6 range. After some more digging I see that I can easy_install argparse on my development system. My question is will I be able to ship this to a customer? Can I create .pyc files so that the customer does not have to install the argparse module? If not, and I want to go back into the 2.3+ range, should I just use optparse? I guess what I am asking here is are there any guidelines/recommendations for shipping python programs to customers? Thanks in advance, Kris If you intend for the software to run on Python 2.7 the user must have argparse installed. Python included argparse in the standard library in 2.7. Understand that getopt is analog to the getopt found in the POSIX library; optparse and argparse are designed to handle more complex arguments. Basically it depends on your needs. If you're concerned about portability it's very easy to deal with arguments with getopt or just sys.argv on your own. -- http://mail.python.org/mailman/listinfo/python-list
Re: Usefulness of the not in operator
On Sat, Oct 08, 2011 at 12:34:42PM -0400, Roy Smith wrote: In article 4e906108$0$27980$426a3...@news.free.fr, candide candide@free.invalid wrote: After browsing source code, I realize that parenthesis are not necessary (not has higher precedence than in). Here's my take on parenthesis: If you need to look up whether they're necessary or not, they are :-) So we don't need precedence charts in the bathroom? -- http://mail.python.org/mailman/listinfo/python-list
Re: Is it possible to create C-style main function in Python? (for teaching purposes)
On Tue, Oct 04, 2011 at 08:20:34PM -0700, alex23 wrote: Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Imported modules are variables like any other, and as they usually exist in the global scope, so they will all need to be explicitly referenced as global. This will get tiresome very quickly, and is a cure far worse than the disease, and alone is enough to disqualify this suggestion from serious consideration. But on the gripping hand, it is a clear triumph of Explicit is better than implicit. ;) Simple is better than complex. Readability counts. -- http://mail.python.org/mailman/listinfo/python-list
Re: recommend a graphics library for plotting by the pixel?
On Wed, Oct 05, 2011 at 02:29:38PM +0100, Adam Funk wrote: On 2011-10-04, Derek Simkowiak wrote: If this is strictly for 2D pixel graphics, I recommend using PyGame (aka SDL). Why do you not think it's the way to go? It was built for this type of thing. I only know PyGame because we did an exercise in recreating the old breakout game and messing around with it at a local Python group. I was under the mistaken impression from that exercise that you have to maintain a set of all the objects on the screen and redraw them all every time through the loop that ends with pygame.display.flip() --- *but* I now see that the loop starts with these: clock.tick(tick_rate) screen.fill((0,0,0)) # comes from screen = pygame.display.set_mode((screen_width,screen_height)) # before the loop and that I was then deleting hit bricks, calculating the new positions of the balls, and then redrawing everything that was left on the secondary screen because things were moving around and disappearing. I guess if I don't clear the screen at the beginning of the loop but just blit pixels onto it, when I call display.flip(), it will add the new blittings to what was already there? If that's true, this will be much easier than I thought. The only buttons I have in mind are pause, step, go, and quit, and I can just as easily do those with keypresses. Yep. Blitting is replacing the old colors with new colors. It doesn't replace colors unless you tell it to. -- http://mail.python.org/mailman/listinfo/python-list
Re: syntax enhancement
On Wed, Oct 05, 2011 at 01:31:41PM -0500, Tim Chase wrote: On 10/04/11 20:45, Terry Reedy wrote: On 10/4/2011 9:50 AM, Valiev Sergey wrote: - `[]` - used for list comprehension, - `()` - used for generators, - `[start:stop]` / `[start:stop:step]` - used for slices. The idea is to use `(start:stop)` / `(start:stop:step)` as 'lazy evaluated' slices (like itertools.islice). What do you think about it? a(b) is already used for function calls. Making a(b:c) be something unreleated does not seem like a good idea to me. At present, a[b:c] == a[slice(b,c)]. However, a(slice(b,c)) is already a function call and could not equal a(b:c). I'm very -1 on the initial proposal with parens, but I wouldn't object to generators growing a method (__getitem__?) to do slices via itertools, something like gen = (a for a in iterator if test(a)) for thing in gen[4::2]: do_something(thing) acting something like gen = (a for a in iterator if test(a)) for thing in itertools.islice(gen, start=4, step=2): do_something(thing) -tkc Wait, how would this work fundamentally? A list can be sliced because all the values are there. A generator does not have all its value at once (it generates each value as requested). I don't like change so I look at these kinds of suggestions with lots of scrutiny and biased criticism. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is it possible to create C-style main function in Python? (for teaching purposes)
On Thu, Oct 06, 2011 at 02:44:33PM +1100, Cameron Simpson wrote: On 03Oct2011 13:10, rantingrick rantingr...@gmail.com wrote: | Also for scoping. | | py count = 0 | py def foo(): | ... global.count += 1 | py print count | 1 | | Why? Well because many times i find myself wondering if this or that | variable is local or global -- and when i say global i am speaking | of module scope! The globalDOT cures the ill. I must admit I rarely have this concern. My own module globals are almost entirely CONSTANT type names. (Excluding function and class names.) What's the common ambifuity case for you? I never have this concern either. Python's functions and classes are powerful enough to avoid globals entirely. In C I have a few sometimes and in Fortran and the like they're everywhere. Global variables are POWERFUL and USEFUL but there's a certain paradigm that goes with them, and Python works better with an object-oriented w/ functional elements approach. -- http://mail.python.org/mailman/listinfo/python-list
Re: Is it possible to create C-style main function in Python? (for teaching purposes)
On Mon, Oct 03, 2011 at 09:35:16PM -0700, alex23 wrote: Sorry for hijacking Alec's response but I didn't see the OP. Aivar Annamaa aivar.anna...@gmail.com wrote: I'm looking for a trick or hidden feature to make Python 3 automatically call a main function but without programmers writing `if __name__ == __main__: ...` One direct way is to call it from the command line: python -c import mymodule; mymodule.main() After your students have had to use that verbose form for a while, they'll be more than happy to add the boilerplate themselves to the end of their modules :) Boiler plate is silly. Let the students figure out stuff themselves. The students need to know why global variables in functions is unwieldly, not just not use them because it's cool. When I taught myself Python I quickly realized global variables were unwieldly and usually impractical after using them. -- http://mail.python.org/mailman/listinfo/python-list
Re: overloading operators for a function object
On Fri, Sep 30, 2011 at 09:50:42PM -0700, Fletcher Johnson wrote: Is it possible to overload operators for a function? For instance I would like to do something roughly like... def func_maker(): def func(): pass def __eq__(other): if other == check: return True return False func.__eq__ = __eq__ return func newfunc = func_maker() newfunc == check #true newfunc == no #false I'm curious as to what you're going to use this for. -- http://mail.python.org/mailman/listinfo/python-list
Re: Suggested coding style
On Thu, Sep 29, 2011 at 07:07:28PM -0400, Devin Jeanpierre wrote: However, as you use the new format method you will come to appreciate it. It's an adult beverage with an acquired taste. ;-) Yeah. It's a much more difficult to read thing, but once you learn how to write it it flows faster. Of course, I never managed to learn how to write it... I would suggest that rather than being complicated it is dense. I'm one of the weirdos who is absolutely hostile to the format method and continues to use % formatting. I'm pretty sure it is because of my C background (actually I learned Python before C, and thus learned % formatting in Python). However, I'm not so opposed to it that I've not learned it. It is quite dense, almost feels like something in a scripting language like Perl. Indeed, I did try it for some time, but it was just too heavy and slow for me. Well someday I'll probably be forced to use it, but for anyone else who agrees with me, always know there's at least one Python programmer out there with some (or no) sense. -- http://mail.python.org/mailman/listinfo/python-list
Re: Benefit and belief
On Fri, Sep 30, 2011 at 09:22:59AM -0700, rusi wrote: On Sep 30, 8:58 pm, Neil Cerutti ne...@norwich.edu wrote: On 2011-09-30, DevPlayer devpla...@gmail.com wrote: I still assert that contradiction is caused by narrow perspective. By that I mean: just because an objects scope may not see a certain condition, doesn't mean that condition is non-existant. I also propose that just because something seems to contradict doesn't mean it is false. Take for instance: Look out your window. Is it daylight or night time? You may say it is daylight or you may say it is night time. I would disagree that only one of those conditions are true. Both conditions are true. Always. It is only day (or night) for YOU. But the opposite DOES in fact exist on the other side of the world at the same time. I call this Duality of Nature (and I believe there was some religion somewhere in some time that has the same notion, Budism I think but I could be mistaken). I see such contradictions in what appears to be most truths. You are not alone. Many ancient philosophers, fathers of religious and scientific thought, thought the same. They thought that contradictory qualities could exist in objects simultaneously. For example, they thought that a cat was both big and small, because it was big compared to a mouse and small compared to a house. They didn't notice that big and small were not poperties of the cat, at all but were instead statements about how a cat relates to another object. When you say, It is night, you are making an assertion about a position on the surface of the earth and its relationship to the sun. If you are not discussing a specific a position on the Earth, then you cannot make a meaningful assertion about night or day at all. Night and Day are not qualities of the entire Earth, but only of positions on the Earth. But just imagine that we were all pre-galiliean savages -- knowing nothing about the roundness of the earth, the earth going round and so on and somehow you and I get on the phone and we start arguing: Rusi: Its 9:30 pm Neil: No its 12 noon How many cases are there? We both may be right, I may be wrong (my watch may have stopped) or we both etc ie conflicting data may get resolved within a larger world view (which is what devplayer is probably saying). Until then it is wiser to assume that that larger world view exists (and I dont yet know it) than to assume that since I dont know it it does not exist. For me (admittedly an oriental) such agnosticism (literally I-do-not- know-ness) is as much a foundation for true religiosity as effective science I.e. humility? -- http://mail.python.org/mailman/listinfo/python-list
Re: Benefit and belief
On Fri, Sep 30, 2011 at 11:08:16AM -0700, rantingrick wrote: On Sep 30, 11:36 am, Westley Martínez aniko...@gmail.com wrote: On Fri, Sep 30, 2011 at 09:22:59AM -0700, rusi wrote: On Sep 30, 8:58�pm, Neil Cerutti ne...@norwich.edu wrote: On 2011-09-30, DevPlayer devpla...@gmail.com wrote: I still assert that contradiction is caused by narrow perspective. By that I mean: just because an objects scope may not see a certain condition, doesn't mean that condition is non-existant. I also propose that just because something seems to contradict doesn't mean it is false. Take for instance: Look out your window. Is it daylight or night time? You may say it is daylight or you may say it is night time. I would disagree that only one of those conditions are true. Both conditions are true. Always. It is only day (or night) for YOU. But the opposite DOES in fact exist on the other side of the world at the same time. I call this Duality of Nature (and I believe there was some religion somewhere in some time that has the same notion, Budism I think but I could be mistaken). I see such contradictions in what appears to be most truths. You are not alone. Many ancient philosophers, fathers of religious and scientific thought, thought the same. They thought that contradictory qualities could exist in objects simultaneously. For example, they thought that a cat was both big and small, because it was big compared to a mouse and small compared to a house. They didn't notice that big and small were not poperties of the cat, at all but were instead statements about how a cat relates to another object. When you say, It is night, you are making an assertion about a position on the surface of the earth and its relationship to the sun. If you are not discussing a specific a position on the Earth, then you cannot make a meaningful assertion about night or day at all. Night and Day are not qualities of the entire Earth, but only of positions on the Earth. But just imagine that we were all pre-galiliean savages -- knowing nothing about the roundness of the earth, the earth going round and so on and somehow you and I get on the phone and we start arguing: Rusi: Its 9:30 pm Neil: No its 12 noon How many cases are there? We both may be right, I may be wrong (my watch may have stopped) or we both etc ie conflicting data may get resolved within a larger world view (which is what devplayer is probably saying). Until then it is wiser to assume that that larger world view exists (and I dont yet know it) than to assume that since I dont know it it does not exist. For me (admittedly an oriental) such agnosticism (literally I-do-not- know-ness) is as much a foundation for true religiosity as effective science I.e. humility? @DevPlayer, rusi, Neil, Wes, and group Yes, there are two views of reality; that of the absolute and that of the relative. Both are true. It is always daytime and nighttime simultaneously; if you look at things from a global perspective. However, the true nature of daytime vs nighttime is purely a relative observation. The fact that both exist does not falsify the validity of the relative view. Recognizing the paradox is important and proves you are not confined to your own selfish view points and are in fact an intelligent being What paradox?. -- http://mail.python.org/mailman/listinfo/python-list
Re: Suggested coding style
On Wed, Sep 28, 2011 at 07:11:08PM -0700, rantingrick wrote: On Sep 28, 6:26 pm, Tim Johnson t...@akwebsoft.com wrote: * DevPlayer devpla...@gmail.com [110928 04:31]: On Sep 27, 10:25 pm, alex23 wuwe...@gmail.com wrote: rantingrick rantingr...@gmail.com wrote: Since, like the bible the zen is self contradicting, any argument utilizing the zen can be defeated utilizing the zen. And like the Bible, the Zen was created by humans as a joke. If you're taking it too seriously, that's your problem. If however you want to learn about the accepted rules for formatting code then you need to read PEP-8! PEP 8 is our style guide. Contradiction is only seen by narrow perspectve. Calling the Bible a joke is used to hurt people, not enlighten them. Those words show bitter arrogance, not constructive critism as it ignores how others feel about that book. What benefit to others is gained by calling someones belief a joke? My wife and I are devout christians, but not fundamentalist. We would not take rantingrick too seriously. If _you_ take him seriously, you're just giving him 'street cred'. DevPlayer was not even talking about what i said, he was replying to a statement by Alex23 who said (and i quote) And like the Bible, the Zen was created by humans as a joke. Maybe you should spend the next fifteen or so minutes catching up to the conversation...(ಠ_ಠ)...of course only *after* you clean that egg from your face Perhaps you should spend a little less time on the mailing list and a little more time in church. -- http://mail.python.org/mailman/listinfo/python-list
Re: syntactic sugar for def?
On Wed, Sep 28, 2011 at 07:01:11PM -0400, Terry Reedy wrote: On 9/28/2011 5:26 PM, Ethan Furman wrote: I don't remember if 'def' is sugar for something besides lambda. That is a bit backwards. lambda x: expr(x) is syntactic sugar for def lambda(x): return expr(x) del lambda ;-) lambda is less sugar and more of just a def as an expression. -- http://mail.python.org/mailman/listinfo/python-list
Re: Suggested coding style
On Thu, Sep 29, 2011 at 08:37:53PM +1000, Steven D'Aprano wrote: Westley Martínez wrote: Perhaps you should spend a little less time on the mailing list and a little more time in church. Is that meant as punishment for Rick or for the churchgoers? Hopefully neither, probably both. -- http://mail.python.org/mailman/listinfo/python-list
Re: Suggested coding style
On Thu, Sep 29, 2011 at 05:23:30AM -0700, rantingrick wrote: On Sep 29, 5:37 am, Passiday passi...@gmail.com wrote: What is so bad about breaking code in obscure places? We changed print to a function which broke just about every piece of code every written in this language. (BTW, print should ALWAYS have been a function!) What is so bad then about breaking some very obscure code? We could always have a lengthy deprecation period. Well, I once thought that a print function made a lot of sense. In C, printf is a function, however then I think why print is a function. In C, just about every function has side effects (the return values are more often than not either pointers or status codes). In Python functions are encouraged to not have side-effects, so the implementation of print as a statement or a method makes far more sense than as a function. But maybe I'm just batty as you all think I am. -- http://mail.python.org/mailman/listinfo/python-list
Re: [OT] Benefit and belief
On Thu, Sep 29, 2011 at 02:49:05PM -0400, Devin Jeanpierre wrote: This was a technical discussion, and calling the bible a joke was not necessary at all. It creates a hostile atmosphere. I disagree. It was not an attack on any person nor group of people. If we are to be required to avoid jokes not directed at people, then *that* is an atmosphere hostile to open friendly discussion. Well. It wasn't directly an attack on people exactly. It did mention believers directly. It could certainly be _interpreted_ as an attack (and was interpreted that way), and that's really all that's necessary for a hostile environment. I'm not saying we should censor ourselves exactly. I've always been opposed to harsh _rules_ about what's appropriate and what isn't. But I do think it's important to consider others' feelings. Just because it isn't an attack, doesn't mean it can't hurt peoples' feelings, and I think hurting peoples' feelings is something worth going out of your way to avoid. Anyway, if it was a joke before, it isn't when somebody starts calling some group of people organised conspiracies to support and protect child molesters. The person who wrote the “bible is a joke” intended it as a flippant remark. Countless other flippant remarks pass through here all the time, making jokes at the expense of some idea or other. Christianity will not be an exception to that. That doesn't make it right. Is it OK to make fun of arbitrary ideas as jokes? I don't think so. It seems, again, hurtful. Especially when the idea is totally unrelated. It's like we're having a discussion about dynamic typing and somebody blurts out Hahaha, static typing is almost as dumb as Cartesian Dualism. The best case outcome is that nobody cares. The worse case outcomes go down to hurt feelings and flame wars from dualists. But the topic of keeping this forum safe for technical discussion entails that it must be safe for *any* idea to be the butt of a joke, be it a religious text or the Zen of Python, and that is very much on-topic. It obviously isn't safe to joke about any topic, seeing as it caused a derailment and new thread. Sometimes it's just not appropriate to joke. Save them for the dates. -- http://mail.python.org/mailman/listinfo/python-list
[OT] Off-Topic Posts and Threads on the Python Mailing List
I'm kind of new to the whole mailing list thing, but they seem to be a lot more lenient than internet forums about most things. I've noticed that sometimes Off-topic posts can get a little out of hand. I guess it's not really a big deal, but it bothers me, and the trolls just love to feed on it. I mean, as programmers, we should devote our time to improving computer systems. On this mailing list, we're programmers, nothing else, and so we shouldn't mingle other things into the list. Think of it as using global variables or even a goto. That's essentially what OT is. It just serves to obfuscate valuable answers to good programming questions. -- http://mail.python.org/mailman/listinfo/python-list
Re: Operator commutativity
On Mon, Sep 19, 2011 at 01:11:51PM +0200, Henrik Faber wrote: Hi there, when I have a python class X which overloads an operator, I can use that operator to do any operation for example with an integer y = X() + 123 however, say I want the + operator to be commutative. Then y = 123 + X() should have the same result. However, since it does not call __add__ on an instance of X, but on the int 123, this fails: TypeError: unsupported operand type(s) for +: 'int' and 'X' How can I make this commutative? Best regards, Henri def __radd__(self, other): return self.__add__(self, other) -- http://mail.python.org/mailman/listinfo/python-list
Re: Operator commutativity
On Mon, Sep 19, 2011 at 10:26:30PM -0400, Roy Smith wrote: In article 4e77eae1$0$29978$c3e8da3$54964...@news.astraweb.com, Steven D'Aprano steve+comp.lang.pyt...@pearwood.info wrote: Westley Mart??nez wrote: def __radd__(self, other): return self.__add__(self, other) Which, inside a class, can be simplified to: __radd__ = __add__ Ooh, I could see that leading to some weird diagnostics. For example: class Foo: def __add__(self, other): raise Exception __radd__ = __add__ f1 = Foo() print 1 + f1 produces: ./add.py Traceback (most recent call last): File ./add.py, line 11, in module print 1 + f1 File ./add.py, line 5, in __add__ raise Exception Exception which leaves the user wondering why __add__() was called when clearly __radd__() should have been. The way Westley wrote it (modulo fixing the __add__() call signature) produces: ./add.py Traceback (most recent call last): File ./add.py, line 11, in module print 1 + f1 File ./add.py, line 8, in __radd__ return self.__add__(other) File ./add.py, line 5, in __add__ raise Exception Exception which at least is a stack trace that shows that __radd__() was called. Calling __radd__ = __add__ simply creates a reference to __add__ named __radd__, it doesn't create a new method. -- http://mail.python.org/mailman/listinfo/python-list
Re: Python bug in Windows 8--report now, or later?
On Sun, Sep 18, 2011 at 04:15:57AM +, Grant Edwards wrote: On 2011-09-17, Chris Angelico ros...@gmail.com wrote: I would consider reporting it as a bug in Windows 8, not a bug in whatever Good luck with that plan. ;) [I don't know anything about this particular issue, but I do know that when there is a bug in Windows, it's usually everyboyd else that has to change to work around it.] Actually Microsoft usually goes out of its way to ensure backwards- compatibily, even when the app developer is DOING IT WRONG. -- http://mail.python.org/mailman/listinfo/python-list
Re: stackoverflow and c.l.py
On Thu, Sep 15, 2011 at 09:58:32AM +1000, Steven D'Aprano wrote: memilanuk wrote: On 09/14/2011 05:47 AM, Chris Angelico wrote: The SNR here isn't bad either. Most of the spam gets filtered out, and even stuff like Ranting Rick posts can be of some amusement when it's a slow day... I subscribe to the list via Gmane, and if 'most of the spam' gets filtered out, I'd hate to see how much gets submitted as I still see 2-5 minimum blatant spam per day on here. 2-5 spam posts is nothing. (Well, I know any spam is too much spam, but still.) Since nearly all of it is obvious, it's easy to filter out of your mail client, news client, or if all else fails, your attention. The hard ones to ignore are the ones that look like they might be legitimate, but fortunately most spammers are too lazy or stupid to bother with even the most feeble disguise. Either way, I don't consider half a dozen spam posts a day to be anything more than a minor distraction. Commercial spam is annoying, but otherwise harmless because it is so easy to filter. What's really the problem is crackpots, trollers and griefers, because there is a terrible temptation to engage them in debate: someone is wrong on the Internet!. If you want to see a news group gone bad, go to something like sci.math. You can't move for the cranks disproving Cantor's Diagonal Theorem and Special Relativity and proving that 10**603 is the One True Actual Infinity (I'm not making that last one up!). This is really what I love and hate about the internet. It's full of people who argue for the sake of venting their internal frustrations. How many discussions comparing declarative and imperative programming languages have you seen on the web? They are everywhere. Really, there's no point to these discussions, just use what you like, but it's still fun to read and think. This goes into all kinds of subjects. That said, this post is somewhat of a rant and may spur debate. It is what it is, no matter where you are, the internet is just a natural breeder of this kind of thing. -- http://mail.python.org/mailman/listinfo/python-list
Re: stackoverflow and c.l.py
On Wed, Sep 14, 2011 at 10:47:15PM +1000, Chris Angelico wrote: On Wed, Sep 14, 2011 at 10:33 PM, memilanuk memila...@gmail.com wrote: Not saying one is necessarily better than the other, but just subscribing to the feed for the [python] tag on SO has a pretty good SNR... The SNR here isn't bad either. Most of the spam gets filtered out, and even stuff like Ranting Rick posts can be of some amusement when it's a slow day... ChrisA And IMO the quality of [Python] code here is better than at SO. -- http://mail.python.org/mailman/listinfo/python-list
Re: stackoverflow and c.l.py
On Wed, Sep 14, 2011 at 06:05:23AM -0700, memilanuk wrote: On 09/14/2011 05:47 AM, Chris Angelico wrote: The SNR here isn't bad either. Most of the spam gets filtered out, and even stuff like Ranting Rick posts can be of some amusement when it's a slow day... I subscribe to the list via Gmane, and if 'most of the spam' gets filtered out, I'd hate to see how much gets submitted as I still see 2-5 minimum blatant spam per day on here. Rick Xang Li are two examples of what you *don't* see (or at least I don't) @ SO I don't understand the matter of spam and trolls. You can just delete it if you don't want it. It's not like we're getting thousands per day. -- http://mail.python.org/mailman/listinfo/python-list
Re: How to structure packages
First of all MyClass.py should be renamed to myclass.py. Module names should be lowercase. Secondly, put this in __init__.py: from .myclass import MyClass and there you go. On Wed, Sep 07, 2011 at 08:56:32AM -0700, bclark76 wrote: I'm learning python, and was playing with structuring packages. Basically I want to have a package called mypackage that defines a number of classes and functions. so I create: mypackage __init__.py myfunc.py MyClass.py my __init__.py is blank. my MyClass.py looks like: import blah class MyClass(blahblah): blah blah blah then I have a run.py that looks like from mypackage import MyClass x = MyClass() This doesn't work because MyClass is mypackage.MyClass.MyClass. There's this MyClass module 'in the way'. I'm trying to follow the rule that every file defines only one class. I could define MyClass in __init__.py, but then what if I wanted to define more classes in the mypackage package? My one class per file rule goes out the window. Is this rule wrongheaded, or is there another way to do this? Thanks. -- http://mail.python.org/mailman/listinfo/python-list -- http://mail.python.org/mailman/listinfo/python-list
[issue11340] test_distutils fails because of borked compress program
Westley Martínez aniko...@gmail.com added the comment: https://bugs.archlinux.org/task/25908 Looks like Allan will be taking care of this problem (eventually). I think this bug can be closed. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue11340 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com