[issue13004] pprint: add option to truncate sequences
Changes by Steven Samuel Cole : -- nosy: +ssc title: pprint: add option to truncate seqeunces -> pprint: add option to truncate sequences ___ Python tracker <http://bugs.python.org/issue13004> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13010] devguide doc: ./python.exe on OS X
New submission from Steven Samuel Cole : it says in the last paragraph of the chapter at http://docs.python.org/devguide/setup.html#unix: [...] ./python.exe on OS X [...] .exe seems to indicate that should probably be './python.exe on Windows' -- assignee: docs@python components: Documentation messages: 144298 nosy: docs@python, ssc priority: normal severity: normal status: open title: devguide doc: ./python.exe on OS X ___ Python tracker <http://bugs.python.org/issue13010> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13010] devguide doc: ./python.exe on OS X
Steven Samuel Cole added the comment: i've gone through the process of checking out and building python as described in the devguide; it seems the python executable is indeed called python.exe under mac osx. i find this confusing. a comment on the reason for this unusual suffix would be great, but an added "(sic!)" would already indicate this is not an erroneous mixup of OS names (as i initially assumed). -- ___ Python tracker <http://bugs.python.org/issue13010> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13010] devguide doc: ./python.exe on OS X
Steven Samuel Cole added the comment: from my observations, david is correct, but this is not limited to os x. i have checked out and rebuilt python twice on a linux system (kubuntu 10.10 i386 virtual machine): 1. in a 'conventional' setup using a local (i.e. guest) harddrive formatted with a case-sensitive file system such as ext4, the built executable is called 'python' as one would expect. 2. in my setup mounting the source code folder from a cifs/samba share provided by the host, the executable is called 'python.exe': samba is not case sensitive. once you know about case sensitivity and python / Python, the sentence in the docs makes absolute sense. before that, it looks like someone has mixed up os names. suggestion for a rephrase: instead of "Once CPython is done building you will then have a working build that can be run in-place; ./python on most machines (and what is used in all examples), ./python.exe on OS X (when on a case-insensitive filesystem, which is the default)." "Once CPython is done building you will then have a working build that can be run in-place; ./python on most machines (and what is used in all examples), ./python.exe wherever a case-insensitive filesystem is used (e.g. the OS X default setting)." -- ___ Python tracker <http://bugs.python.org/issue13010> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue13004] pprint: add option to truncate sequences
Steven Samuel Cole added the comment: @anand: as the names say, the depth parameter limits the depth of display while the length parameter limits the length. for example, with a data structure of a list of lists of lists and a depth of 2, only the first two levels would be shown, the third list at the 'bottom' would be replaced by '...' on the other hand, in a list with 10 entries and a length parameter of 5, only 5 list entries would be displayed. @Raymond: agreed. i have squeezed max_len into the existing code and ported that back to 2.6 for my current project; while it works, it is a bad hack. i would much more prefer bundling efforts into an extensible pprint rewrite. -- ___ Python tracker <http://bugs.python.org/issue13004> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue7434] general pprint rewrite
Changes by Steven Samuel Cole : -- nosy: +ssc ___ Python tracker <http://bugs.python.org/issue7434> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later
New submission from Steven Samuel Cole : inside a function, I create a local variable by using setattr with the current module as object, as in setattr(modules[__name__], 'name', 'value') if I _later_ in the code set name to None, the attribute becomes unavailable even for code that is executed _before_ setting name to None. please also see sample file. -- components: Interpreter Core files: show_weird_behavior.py messages: 118099 nosy: ssc priority: normal severity: normal status: open title: UnboundLocalError with local variable set by setattr, caused by code run later type: behavior versions: Python 2.6, Python 2.7 Added file: http://bugs.python.org/file19146/show_weird_behavior.py ___ Python tracker <http://bugs.python.org/issue10043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later
Steven Samuel Cole added the comment: I'm just a developer, I don't know anything about Python internals or what Python sees or does at what stage. Looking at the sample file, code executed later has an influence on code executed earlier - and that behavior is unexpected, confusing, bizarre, no matter what expert explanations there are. It took me a while to isolate this problem, thought I report it here to save others the effort. This should at least be mentioned in the docs somewhere around setattr(...). I think it is premature to declare this report invalid and close the bug - but hey, if _you_ are not interested in improving Python wherever possible, why would _I_ be ? -- ___ Python tracker <http://bugs.python.org/issue10043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10043] UnboundLocalError with local variable set by setattr, caused by code run later
Steven Samuel Cole added the comment: thank you very much for the clarification. i did indeed not come across the page you've linked to, mainly because i did not really know what to google for. actually, i do not recall ever looking into the python language reference in 6+ years of python coding. googling for 'python UnboundLocalError setattr' returns this bug report as top result at the moment, as your link leads to more indepth information, the main objective of saving / alleviating others the research work seems achieved. i will nonetheless try to make time to get get my head around the python doc conventions and processes and submit a patch. thanks for pointing out the difference between a local variable and one with module scope. however, it is not relevant for my situation: i have a long list of strings coming in (database column names, not under my influence) which i need to access _like_ a local variable. if you can think of a smarter approach to turn parameter strings into variables of whatever scope, i'm all ears, but i have a feeling that's actually what setattr(...) is meant for. as a quick fix for the UnboundLocalError, sticking to working with module attributes worked for me. instead of changing the value of a dynamically created variable in the conventional way my_var = None (which is where the error occurred in my code), it might help to use setattr(...) even if the variable name is known: setattr(modules[__name__], 'my_var', None) -- ___ Python tracker <http://bugs.python.org/issue10043> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue11843] distutils doc: duplicate line in table
New submission from Steven Samuel Cole : in the first table on http://docs.python.org/distutils/builtdist.html (search for 'available formats for built distributions'), the line with 'rpm / RPM / (5)' is in there twice -- assignee: docs@python components: Documentation messages: 133730 nosy: docs@python, ssc priority: normal severity: normal status: open title: distutils doc: duplicate line in table versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3 ___ Python tracker <http://bugs.python.org/issue11843> ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue2943] Distutils should generate a better error message when the SDK is not installed
Changes by Steven Samuel Cole : -- nosy: +ssc ___ Python tracker <http://bugs.python.org/issue2943> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com