RedNotebook 1.5

2012-10-31 Thread Jendrik Seipp

A new RedNotebook version has been released.

You can get the tarball, the Windows installer and links to distribution
packages at
http://rednotebook.sourceforge.net/downloads.html


What is RedNotebook?

RedNotebook is a **graphical journal** and diary helping you keep track
of notes and thoughts. It includes a calendar navigation, customizable
templates, export functionality and word clouds. You can also format,
tag and search your entries. RedNotebook is available in the
repositories of most common Linux distributions and a Windows installer
is available. It is written in Python and uses GTK+ for its interface.


What's new?
---
* Inline #hashtagging: Directly add hashtags like #Movies, #my_project 
in the main text.

* Highlight #hashtags in red.
* Include # for tags in tag cloud to be consistent with the hashtags.
* Change to edit/preview mode if text is missing/present automatically.
* Change to edit mode when double-clicked into preview.
* Detach model from combobox when updating the tags to make inserting a 
new tag faster.

* Fix searching for dates.
* Fix inserting and editing templates with unicode names.
* Fix opening and creating journals (lp:1068655)
* Use apport (If a crash occurs on Linux, an automatic bug report is 
prepared, but not submitted)

* Do not allow using $HOME as a journal directory.
* Do not let error notifications blink.
* For Journal-New and Journal-Save-As: Only allow using empty directories.
* For Journal-Open: Only allow using directories with at least one 
month file.

* Use InfoBars for nicer inline notifications about errors.
* Enable finishing link dialog with hitting ENTER.
* Disable insert (Ctrl+V) and cut (Ctrl+X) shortcuts in preview mode.
* Add more shortcuts in Journal menu: Export (Ctrl+E), Backup and 
Statistics (Alt+letter).

* Update translations.


Cheers,
Jendrik





--
http://mail.python.org/mailman/listinfo/python-announce-list

   Support the Python Software Foundation:
   http://www.python.org/psf/donations/


Re: Negative array indicies and slice()

2012-10-31 Thread Andrew Robinson

On 10/30/2012 10:29 PM, Michael Torrie wrote:
As this is the case, why this long discussion? If you are arguing for 
a change in Python to make it compatible with what this fork you are 
going to create will do, this has already been fairly thoroughly 
addressed earl on, and reasons why the semantics will not change 
anytime soon have been given. 


I'm not arguing for a change in the present release of Python; and I 
have never done so.
Historically, if a fork happens to produce something surprisingly 
_useful_; the main code bank eventually accepts it on their own.  If a 
fork is a mistake, it dies on its own.


That really is the way things ought to be done.

   include this
   The Zen of Python, by _Tim Peters_
   
   Special cases aren't special enough to break the rules.
   Although _practicality beats purity_.
   

Now, I have seen several coded projects where the idea of cyclic lists 
is PRACTICAL;
and the idea of iterating slices may be practical if they could be made 
*FASTER*.


These warrant looking into -- and carefully;  and that means making an 
experimental fork; preferably before I attempt to micro-port the python.


Regarding the continuing discussion:
The more I learn, the more informed decisions I can make regarding 
implementation.

I am almost fully understanding the questions I originally asked, now.

What remains are mostly questions about compatibility wrappers, and how 
to allow them to be used -- or selectively deleted when not necessary; 
and perhaps a demonstration or two about how slices and named tuples can 
(or can't) perform nearly the same function in slice processing.


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Negative array indicies and slice()

2012-10-31 Thread Ian Kelly
On Tue, Oct 30, 2012 at 4:25 PM, Andrew Robinson
andr...@r3dsolutions.com wrote:
 Ian,

 Looks like it's already been wontfixed back in 2006:

 http://bugs.python.org/issue1501180

 Absolutely bloody typical, turned down because of an idiot.  Who the hell is
 Tim Peters anyway?

 I don't really disagree with him, anyway.  It is a rather obscure bug
 -- is it worth increasing the memory footprint of slice objects by 80%
 in order to fix it?

 :D

 In either event, a *bug* does exist (at *least* 20% of the time.)  Tim
 Peters could have opened the *appropriate* bug complaint if he rejected the
 inappropriate one.

Where are you getting that 20% figure from?  Reference cycles
involving slice objects would be extremely rare, certainly far less
than 20%.

 The API ought to have either 1) included the garbage collection, or 2)
 raised an exception anytime dangerous/leaky data was supplied to slice().

How would you propose detecting the latter?  At the time data is
supplied to slice() it cannot refer to the slice, as the slice does
not exist yet.  The cycle has to be created after.

 If it is worth getting rid of the 4 words of extra memory required for the
 GC -- on account of slice() refusing to support data with sub-objects; then
 I'd also point out that a very large percentage of the time, tuples also
 contain data (typically integers or floats,) which do not further
 sub-reference objects.  Hence, it would be worth it there too.

I disagree.  The proportion of the time that a tuple contains other
collection objects is *much* greater.  This happens regularly.  OTOH,
if I had to hazard a guess at the frequency with which non-atomic
objects are used in slices, it would be a fraction of a fraction of a
fraction of a percent.

 I came across some unexpected behavior in Python 3.2 when experimenting with
 ranges and replacement

 Consider, xrange is missing, BUT:

More accurately, range is gone, and xrange has been renamed range.

 a=range(1,5,2)
 a[1]
 3
 a[2]
 5
 a[1:2]
 range(3, 5, 2)

 Now, I wondered if it would still print the array or not; eg: if this was a
 __str__ issue vs. __repr__.

 print( a[1:2] ) # Boy, I have to get used to the print's parenthesis
 range(3, 5, 2)

 So, the answer is *NOPE*.

I'm not sure why you would expect it to print a list here, without an
explicit conversion.  The result of calling range in Python 3 is a
range object, not a list.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: calling one staticmethod from another

2012-10-31 Thread Ulrich Eckhardt

Am 30.10.2012 18:23, schrieb Jean-Michel Pichavant:

- Original Message -
[snip]

I haven't figured out the justification for staticmethod,


http://en.wikipedia.org/wiki/Namespace
+
Namespaces are one honking great idea -- let's do more of those!

Someone may successfully use only modules as namespaces, but classes
can be used as well. It's up to you.


Indeed, see e.g. Steven D'Aprano's approach at formalizing that:

http://code.activestate.com/recipes/578279/


Greetings!

Uli

--
http://mail.python.org/mailman/listinfo/python-list


Re: Negative array indicies and slice()

2012-10-31 Thread Steven D'Aprano
On Tue, 30 Oct 2012 21:33:32 +, Mark Lawrence wrote:

 On 30/10/2012 18:02, Ian Kelly wrote:
 On Tue, Oct 30, 2012 at 10:14 AM, Ethan Furman et...@stoneleaf.us
 wrote:
 File a bug report?

 Looks like it's already been wontfixed back in 2006:

 http://bugs.python.org/issue1501180


 Absolutely bloody typical, turned down because of an idiot.  Who the
 hell is Tim Peters anyway? :)

I see your smiley, but for the benefit of those who actually don't know 
who Tim Peters, a.k.a. the Timbot, is, he is one of the gurus of Python 
history. He invented Python's astonishingly excellent sort routine, 
Timsort, and popularised the famous adverbial phrase signoffs you will 
see in a lot of older posts.

Basically, he is in the pantheon of early Python demigods.


stop-me-before-i-start-gushing-over-the-timbot-ly y'rs,



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


working with yml files in python and opencv

2012-10-31 Thread inshu chauhan
How to load a yml file in python and work with it ??

I used : import cv
data = cv.Load(Z:/data/xyz_0_300.yml)

But when I print data.. it just gives the detail of the image like number
of rows and columns etc
I want read what is there in the pixel of the image.. can somebody help..
thanx in advance !!!
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread Grant Edwards
On 2012-09-16,  ?? nikos.gr...@gmail.com wrote:

 Iam positng via google groups using chrome, thats all i know.

Learn something else.  Google Groups is seriously and permanently
broken, and all posts from Google Groups are filtered out and ignored
by many people (including myself -- I only saw this because somebody
else replied to it).

IMO, the best option is to point a newsreader an an NNTP server that
carries comp.lang.python (gname.org also provides an NNTP server that
gateways to the mailing list).  Pointing a newsreader at gmane's NNTP
server is also an excellent option.

If all you can do is run a browwer, then I suggest using gmane.org:

   http://news.gmane.org/gmane.comp.python.general

 Whats a mailing list?

  http://en.wikipedia.org/wiki/Electronic_mailing_list
  http://www.python.org/community/lists/

The python mailing list is gatewayed to the Usenet newsgroup
comp.lang.python (which is where I read/post from):

  http://en.wikipedia.org/wiki/Usenet

 Can i get responses to my mail instead of constantly check the google
 groups site?

Yes.  You can subscribe directly to the list (which means you'll
receive a _lot_ of e-mail every day).

-- 
Grant Edwards   grant.b.edwardsYow! If I felt any more
  at   SOPHISTICATED I would DIE
  gmail.comof EMBARRASSMENT!
-- 
http://mail.python.org/mailman/listinfo/python-list


sort order for strings of digits

2012-10-31 Thread djc
I learn lots of useful things from the list, some not always welcome. No 
sooner had I found a solution to a minor inconvenience in my code, than 
a recent thread here drew my attention to the fact that it will not work 
for python 3. So suggestions please:


TODO 2012-10-22: sort order numbers first then alphanumeric
 n
('1', '10', '101', '3', '40', '31', '13', '2', '2000')
 s
('a', 'ab', 'acd', 'bcd', '1a', 'a1', '222 bb', 'b a 4')

 sorted(n)
['1', '10', '101', '13', '2', '2000', '3', '31', '40']
 sorted(s)
['1a', '222 bb', 'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']
 sorted(n+s)
['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40', 
'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']




Possibly there is a better way but for Python 2.7 this gives the 
required result


Python 2.7.3 (default, Sep 26 2012, 21:51:14)

 sorted(int(x) if x.isdigit() else x for x in n+s)
[1, 2, 3, 10, 13, 31, 40, 101, 2000, '1a', '222 bb', 'a', 'a1', 'ab', 
'acd', 'b a 4', 'bcd']



[str(x) for x in sorted(int(x) if x.isdigit() else x for x in n+s)]
['1', '2', '3', '10', '13', '31', '40', '101', '2000', '1a', '222 bb', 
'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']



But not for Python 3
Python 3.2.3 (default, Oct 19 2012, 19:53:16)

 sorted(n+s)
['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40', 
'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']


 sorted(int(x) if x.isdigit() else x for x in n+s)
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: unorderable types: str()  int()


The best I can think of is to split the input sequence into two lists, 
sort each and then join them.



--
djc

--
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Hans Mulder
On 31/10/12 16:17:14, djc wrote:
 Python 3.2.3 (default, Oct 19 2012, 19:53:16)
 
 sorted(n+s)
 ['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40',
 'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']
 
 sorted(int(x) if x.isdigit() else x for x in n+s)
 Traceback (most recent call last):
   File stdin, line 1, in module
 TypeError: unorderable types: str()  int()


 sorted(n+s, key=lambda x:(x.__class__.__name__, x))
['1', '10', '101', '13', '1a', '2', '2000', '222 bb', '3', '31', '40',
'a', 'a1', 'ab', 'acd', 'b a 4', 'bcd']


 The best I can think of is to split the input sequence into two lists,
 sort each and then join them.

That might well be the most readable solution.


Hope this helps,

-- HansM
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 9:17 AM, djc djc@kangoo.invalid wrote:
 The best I can think of is to split the input sequence into two lists, sort
 each and then join them.

In the example you have given they already seem to be split, so you
could just do:

sorted(n, key=int) + sorted(s)

If that's not really the case, then you could construct (str, int)
tuples as sort keys:

sorted(n+s, key=lambda x: ('', int(x)) if x.isdigit() else (x, -1))

Note that the empty string sorts before all numbers here, which may or
may not be desirable.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Float to String

2012-10-31 Thread Mark Dickinson
 andrew.mackeith at 3ds.com writes:

 When formatting a float using the exponential format, the rounding is
 different in Python-2.6 and Python-2.7. See example below.  Is this
 intentional?

Yes, in a sense.  Python = 2.6 uses the OS-provided functionality (e.g., the C
library's strtod, dtoa and sprintf functions) to do float-to-string and
string-to-float conversions, and hence behaves differently from platform to
platform.  In particular, it's common for near halfway cases (like the one
you're looking at here) and tiny numbers to give different results on different
platforms.  Python = 2.7 has its own built-in code for performing
float-to-string and string-to-float conversions, so those conversions are
platform- independent and always correctly rounded.  (Nitpick: it's still
theoretically possible for Python 2.7 to use the OS code if it can't determine
the floating-point format, or if it can't find a way to ensure the proper FPU
settings, but I don't know of any current platforms where that's the case.)

 Is there any way of forcing the Python-2.6 behavior (for compatibility
 reasons when testing)?

Not easily, no.

--
Mark


-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Negative array indicies and slice()

2012-10-31 Thread Mark Lawrence

On 31/10/2012 10:07, Steven D'Aprano wrote:

On Tue, 30 Oct 2012 21:33:32 +, Mark Lawrence wrote:


Absolutely bloody typical, turned down because of an idiot.  Who the
hell is Tim Peters anyway? :)


I see your smiley, but for the benefit of those who actually don't know
who Tim Peters, a.k.a. the Timbot, is, he is one of the gurus of Python
history. He invented Python's astonishingly excellent sort routine,
Timsort, and popularised the famous adverbial phrase signoffs you will
see in a lot of older posts.

Basically, he is in the pantheon of early Python demigods.

stop-me-before-i-start-gushing-over-the-timbot-ly y'rs,



4 / 10, must try harder, the omission of the Zen of Python is considered 
a very serious matter :)


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Need 4 Python Developer // Times Sq - New York // 15+ Months Contract.

2012-10-31 Thread raj
Hi Friends,
 
Hope you are doing great.
 
This is Rajesh from NYTP.
I wanted to let you know about New Job opening in Times Sq - New York. It is a 
15+ months Contract.

Role :  Python Developer
Location   :  Times Sq - New York
Duration   :  15+ Months Contract

Positions :  4
 
Project currently in the Development Phase

Qualifications:

   4-6 years of development experience with object-oriented languages
   3+ years of Python development experience
   Knowledge of HTML5 and Javascript is a plus
   Experience developing applications for AWS
   Agile development experience a plus
   Demonstrated ability to work in a team environment
   Good unit testing practices
   Good communication and documentation skills
   Willingness to interact and work with different teams across 
organizations in different time zones
   Willingness to work overtime and weekends if required
   Bachelor’s degree in Computer Science
   Required Skills:
   Strong in object-oriented concepts and Python language
   Experience developing web applications with Tornado
   Working knowledge of software design patterns
   Familiar with N-Tier caching strategies
   Familiar with REST and JSON
   Knowledgeable about MongoDB and REDIS 

If you are available and interested in this positions. Please send me an 
updated resume. Please feel free to contact me for any further information.
___
 
New York Technology Partners – Rochester

Rajesh Kaluri
332 Jefferson Rd.
Rochester, NY 14623 
Phone: (201) 680 - 0200 x7023   

Fax: (201) 474 - 8533
r...@nytpartners.com
www.nytp.com
Profile : http://in.linkedin.com/pub/k-rajeshwar/8/51a/13

 

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obnoxious postings from Google Groups

2012-10-31 Thread rurpy
On 10/30/2012 11:07 PM, Robert Miles wrote: On 9/16/2012 8:18 AM, Ben Finney 
wrote:
 Νικόλαος Κούρας nikos.gr...@gmail.com writes:

 Iam sorry i didnt do that on purpose and i dont know how this is done.

 Iam positng via google groups using chrome, thats all i know.

 It is becoming quite clear that some change has happened recently to
 Google Groups that makes posts coming from there rather more obnoxious
 than before. And there doesn't seem to be much its users can do except
 use something else.

You (BF) are wrong that there doesn't seem to be much its users
can do... and I explained why previously.  However, since you have
advocated killfiling anyone using GG (which I do) you probably didn't
see my post.  If you choose intentional ignorance that is your choice
but you do a disservice to the community by advocating that others
do the same.

(Officer, I don't deserve this ticket because I couldn't see the 
traffic signal was red; I had my eyes closed. :-)

 You're probably referring to their change in the way they handle
 end-of-lines, which is now incompatible with most newsreaders,
 especially with multiple levels of quoting.

It's a minor pain to fix this when posting, but

1. It is fixable (and previous post of mine gave a couple ways)
2. The double spacing is obvious in Google's compose window
 so if one posts anyway, it is a matter of laziness.

 The incompatibility tends to insert a blank line after every line.
 With multiple levels of quoting, this gives blank line groups that
 often roughly double in size for every level of quoting.
 
 Robert Miles
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread rurpy
On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16,  ?? 
nikos.gr...@gmail.com wrote:
 
 Iam positng via google groups using chrome, thats all i know.
 
 Learn something else.  Google Groups is seriously and permanently
 broken, and all posts from Google Groups are filtered out and ignored
 by many people (including myself -- I only saw this because somebody
 else replied to it).

Broken?  Yes.  But so is every piece of software in one way 
or another.  Thunderbird is one of the most perpetually buggy
pierces of software I have ever used on a continuing basis.

Seriously?  That's pretty subjective.  I manage to use it
without major problems so it couldn't be that bad.  I posted
previously on how to use it without the double posts or the
double spacing.

Permenantly?  Your ability to foretell the future leaves me
in awe.  :-)

Feel free to filter whatever you want but be aware than in 
doing so you risk missing information that could help you
avoid disseminating erroneous info.  Of course, carrying out
some kind of private war against Google Groups may be more
important to you than that... 
-- 
http://mail.python.org/mailman/listinfo/python-list


RE: date and time comparison how to

2012-10-31 Thread Prasad, Ramit
Gary Herron wrote:
 On 10/29/2012 04:13 PM, noydb wrote:
  All,
 
  I need help with a date and time comparison.
 
  Say a user enters a date-n-time and a file on disk.  I want to compare the 
  date and time of the file to the
 entered date-n-time; if the file is newer than the entered date-n-time, add 
 the file to a list to process.
 
  How best to do?  I have looked at the datetime module, tried a few things, 
  no luck.
 
  Is os.stat a part of it?  Tried, not sure of the output, the 
  st_mtime/st_ctime doesnt jive with the file's
 correct date and time.  ??
 
  Any help would be appreciated!
 
 Use the datetime module (distributed with Python) to compare date/times.
 
 You can turn a filesystem time into a datetime with something like the
 following:
  import datetime, os, stat
  mtime = os.lstat(filename)[stat.ST_MTIME]   // the
 files modification time
  dt = datetime.datetime.fromtimestamp(mtime)
 

You could also write that as:

datetime.datetime.fromtimestamp( os.path.getmtime( path ) )


Ramit P


This email is confidential and subject to important disclaimers and
conditions including on offers for the purchase or sale of
securities, accuracy and completeness of information, viruses,
confidentiality, legal privilege, and legal entity disclaimers,
available at http://www.jpmorgan.com/pages/disclosures/email.  
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Negative array indicies and slice()

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 7:42 AM, Andrew Robinson
andr...@r3dsolutions.comwrote:

 Then; I'd note:  The non-goofy purpose of slice is to hold three data
 values;  They are either numbers or None.  These *normally* encountered
 values can't create a memory loop.
 So, FOR AS LONG, as the object representing slice does not contain an
 explicit GC pair; I move that we mandate (yes, in the current python
 implementation, even as a *fix*) that its named members may not be assigned
 any objects other than None or numbers

 eg: Lists would be forbidden

 Since functions, and subclasses, can be test evaluated by int(
 the_thing_to_try ) and *[] can too,
 generality need not be lost for generating nothing or numbers.


PEP 357 requires that anything implementing the __index__ special method be
allowed for slicing sequences (and also that __index__ be used for the
conversion).  For the most part, that includes ints and numpy integer
types, but other code could be doing esoteric things with it.

The change would be backward-incompatible in any case, since there is
certainly code out there that uses non-numeric slices -- one example has
already been given in this thread.
And more wonderful yet, when I do extended slice replacement -- it gives me
results beyond my wildest imaginings!


  a=[0,1,2,3,4,5]
  a[4:5]=range( 0, 3 ) # Size origin=1, Size dest =3
  a
 [0, 1, 2, 3, 0, 1, 2, 5]  # Insert on top of replacement
 
 But !!!NOT!!! if I do it this way:
  a[4]=range( 0, 3 )
  a
 [0, 1, 2, 3, range(0, 3), 1, 2, 5]
 


That's nothing to do with range or Python 3.  It's part of the difference
between slice assignment and index assignment.  The former unpacks an
iterable, and the latter assigns a single object.  You'd get the same
behavior with lists:

 a = list(range(6))
 a[4:5] = list(range(3))
 a
[0, 1, 2, 3, 0, 1, 2, 5]
 a = list(range(6))
 a[4] = list(range(3))
 a
[0, 1, 2, 3, [0, 1, 2], 5]

Slice assignment unpacks the list; index assignment assigns the list itself
at the index.
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence

On 31/10/2012 18:17, Dennis Lee Bieber wrote:


Why -- I doubt Python 3.x .sort() and sorted() have removed the
optional key and cmp keywords.



Nope.  I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be 
very dead.


This doesn't help either.

c:\Users\Mark\Cash\Python2to3.py
Traceback (most recent call last):
  File C:\Python33\Tools\Scripts\2to3.py, line 3, in module
from lib2to3.main import main
ImportError: No module named main

--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread Mark Lawrence

On 31/10/2012 19:35, ru...@yahoo.com wrote:

On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16,  ?? 
nikos.gr...@gmail.com wrote:.

Broken?  Yes.  But so is every piece of software in one way
or another.  Thunderbird is one of the most perpetually buggy
pierces of software I have ever used on a continuing basis



Please provide evidence that Thunderbird is buggy.  I use it quite 
happily, don't have problems, and have never seen anybody complaining 
about it.


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Ian Kelly
On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:

 Nope.  I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be
 very dead.

 This doesn't help either.

 c:\Users\Mark\Cash\Python**2to3.py

 Traceback (most recent call last):
   File C:\Python33\Tools\Scripts\**2to3.py, line 3, in module
 from lib2to3.main import main
 ImportError: No module named main


Perhaps you have a sys.path conflict?

Use functools.cmp_to_key for porting cmp functions.  sort(x, my_cmp)
becomes sort(x, key=cmp_to_key(my_cmp))

The cmp builtin is also gone.  If you need it, the suggested replacement
for cmp(a, b) is (b  a) - (a  b).

Cheers,
Ian
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Obnoxious postings from Google Groups

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 12:32:57 -0700, rurpy wrote:

[...]
 You're probably referring to their change in the way they handle
 end-of-lines, which is now incompatible with most newsreaders,
 especially with multiple levels of quoting.
 
 It's a minor pain to fix this when posting, but
 
 1. It is fixable (and previous post of mine gave a couple ways) 2. The
 double spacing is obvious in Google's compose window
  so if one posts anyway, it is a matter of laziness.

I don't killfile merely for posting from Gmail or Google Groups, but 
regarding your second point, it has seemed to me for some years now that 
Gmail is the new Hotmail, which was the new AOL. Whenever there is an 
inane, lazy, mind-numbingly stupid question or post, chances are 
extremely high that the sender has a Gmail address.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 15:17:14 +, djc wrote:

 The best I can think of is to split the input sequence into two lists,
 sort each and then join them.

According to your example code, you don't have to split the input because 
you already have two lists, one filled with numbers and one filled with 
strings.

But I think that what you actually have is a single list of strings, and 
you are supposed to sort the strings such that they come in numeric order 
first, then alphanumerical. E.g.:

['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
= ['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']

At least that is what I would expect as the useful thing to do when 
sorting.

The trick is to take each string and split it into a leading number and a 
trailing alphanumeric string. Either part may be empty. Here's a pure 
Python solution:

from sys import maxsize  # use maxint in Python 2
def split(s):
for i, c in enumerate(s):
if not c.isdigit():
break
else:  # aligned with the FOR, not the IF
return (int(s), '')
return (int(s[:i] or maxsize), s[i:])

Now sort using this as a key function:

py L = ['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
py sorted(L, key=split)
['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']


The above solution is not quite general:

* it doesn't handle negative numbers or numbers with a decimal point;

* it doesn't handle the empty string in any meaningful way;

* in practice, you may or may not want to ignore leading whitespace,
  or trailing whitespace after the number part;

* there's a subtle bug if a string contains a very large numeric prefix,
  finding and fixing that is left as an exercise.



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Steven D'Aprano
On Wed, 31 Oct 2012 19:05:17 -0400, Dennis Lee Bieber wrote:

 The cmp builtin is also gone.  If you need it, the suggested
 replacement for cmp(a, b) is (b  a) - (a  b).

   OUCH... Just another reason for my to hang onto the 2.x series as
 long as possible 

On the contrary. If you are using cmp with sort, your sorts are slow, and 
you should upgrade to using a key function as soon as possible.

For small lists, you may not notice, but for large lists using a 
comparison function is a BAD IDEA.

Here's an example: sorting a list of numbers by absolute value.

py L = [5, -6, 1, -2, 9, -8, 4, 3, -7, 2, -3]
py sorted(L, key=abs)
[1, -2, 2, 3, -3, 4, 5, -6, -7, -8, 9]
py sorted(L, lambda a, b: cmp(abs(a), abs(b)))
[1, -2, 2, 3, -3, 4, 5, -6, -7, -8, 9]

But the amount of work done is radically different. Let's temporarily 
shadow the built-ins with patched versions:

py _abs = abs
py _abs, _cmp = abs, cmp
py c1 = c2 = 0
py def abs(x):
... global c1
... c1 += 1
... return _abs(x)
...
py def cmp(a, b):
... global c2
... c2 += 1
... return _cmp(a, b)
...

Now we can see just how much work is done under the hood using a key 
function vs a comparison function:

py sorted(L, key=abs)
[1, -2, 2, 3, -3, 4, 5, -6, -7, -8, 9]
py c1
11

So the key function is called once for each item in the list. But:


py c1 = 0  # reset the count
py sorted(L, lambda a, b: cmp(abs(a), abs(b)))
[1, -2, 2, 3, -3, 4, 5, -6, -7, -8, 9]
py c1, c2
(54, 27)

The comparison function is called 27 times for a list of nine items (a 
average of 2.5 calls to cmp per item), and abs is called twice for each 
call to cmp. (Well, duh.)

If the list is bigger, it gets worse:

py c2 = 0
py x = sorted(L*10, lambda a, b: cmp(abs(a), abs(b)))
py c2
592

That's an average of 5.4 calls to cmp per item. And it gets even worse as 
the list gets bigger.

As your lists get bigger, the amount of work done calling the comparison 
function gets ever bigger still. Sorting large lists with a comparison 
function is SLOOOW.

py del abs, cmp  # remove the monkey-patched versions
py L = L*100
py with Timer():
... x = sorted(L, key=abs)
...
time taken: 9.165448 seconds
py with Timer():
... x = sorted(L, lambda a, b: cmp(abs(a), abs(b)))
...
time taken: 63.579679 seconds


The Timer() context manager used can be found here:

http://code.activestate.com/recipes/577896



-- 
Steven
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread DJC

On 31/10/12 23:09, Steven D'Aprano wrote:

On Wed, 31 Oct 2012 15:17:14 +, djc wrote:


The best I can think of is to split the input sequence into two lists,
sort each and then join them.


According to your example code, you don't have to split the input because
you already have two lists, one filled with numbers and one filled with
strings.


Sorry for the confusion, the pair of strings was just a way of testing 
variations on the input. So a sequence with any combination of strings 
that can be read as numbers and strings of chars that don't look like 
numbers (even if that string includes digits) is the expected input




But I think that what you actually have is a single list of strings, and
you are supposed to sort the strings such that they come in numeric order
first, then alphanumerical. E.g.:

['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
= ['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']


Not quite, what I want is to ensure that if the strings look like 
numbers they are placed in numerical order. ie 1 2 3 10 100 not 1 10 100 
2 3. Cases where a string has some leading digits can be treated as 
strings like any other.



At least that is what I would expect as the useful thing to do when
sorting.


Well it depends on the use case. In my case the strings are column and 
row labels for a report. I want them to be presented in a convenient to 
read sequence. Which the lexical sorting of the strings that look like 
numbers is not. I want a reasonable do-what-i-mean default sort order 
that can handle whatever strings are used.





The trick is to take each string and split it into a leading number and a
trailing alphanumeric string. Either part may be empty. Here's a pure
Python solution:

from sys import maxsize  # use maxint in Python 2
def split(s):
 for i, c in enumerate(s):
 if not c.isdigit():
 break
 else:  # aligned with the FOR, not the IF
 return (int(s), '')
 return (int(s[:i] or maxsize), s[i:])

Now sort using this as a key function:

py L = ['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
py sorted(L, key=split)
['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']


The above solution is not quite general:

* it doesn't handle negative numbers or numbers with a decimal point;

* it doesn't handle the empty string in any meaningful way;

* in practice, you may or may not want to ignore leading whitespace,
   or trailing whitespace after the number part;

* there's a subtle bug if a string contains a very large numeric prefix,
   finding and fixing that is left as an exercise.


That looks more than  general enough for my purposes! I will experiment 
along those lines, thank you.



--
http://mail.python.org/mailman/listinfo/python-list


Re: Obnoxious postings from Google Groups

2012-10-31 Thread Arnaud Delobelle
On 31 October 2012 22:33, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
[...]
 I don't killfile merely for posting from Gmail

And we are humbly grateful.

-- 
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread Robert Miles

On 10/31/2012 2:35 PM, ru...@yahoo.com wrote:

On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16,  ?? 
nikos.gr...@gmail.com wrote:



Iam positng via google groups using chrome, thats all i know.


Learn something else.  Google Groups is seriously and permanently
broken, and all posts from Google Groups are filtered out and ignored
by many people (including myself -- I only saw this because somebody
else replied to it).


Seriously?  That's pretty subjective.  I manage to use it
without major problems so it couldn't be that bad.  I posted
previously on how to use it without the double posts or the
double spacing.


If you're using it for reasonable purposes, you won't encounter
its worst flaw.  It's much too easy for spammers to use for
posting spam.  I'd estimate that about 99% of the world's
newsgroups spam in English is posted through Google Groups.

--
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread Robert Miles

On 10/31/2012 4:38 PM, Mark Lawrence wrote:

On 31/10/2012 19:35, ru...@yahoo.com wrote:

On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16, 
?? nikos.gr...@gmail.com wrote:.

Broken?  Yes.  But so is every piece of software in one way
or another.  Thunderbird is one of the most perpetually buggy
pierces of software I have ever used on a continuing basis



Please provide evidence that Thunderbird is buggy.  I use it quite
happily, don't have problems, and have never seen anybody complaining
about it.


Why should they complain about it in this newsgroup?

Most of the people who complain about it know that complaining
in newsgroup mozilla.support.thunderbird is much more likely
to get any problems fixed.  Rather few newsgroups servers are
allowed to carry that newsgroup; news.mozilla.org is one of them.

The newsgroups section of Thunderbird seems to have more bugs
than the email section, partly because there are more volunteers
interested in working on the email section.

--
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Mark Lawrence

On 31/10/2012 22:24, Ian Kelly wrote:

On Wed, Oct 31, 2012 at 3:33 PM, Mark Lawrence breamore...@yahoo.co.ukwrote:


Nope.  I'm busy porting my own code from 2.7 to 3.3 and cmp seems to be
very dead.

This doesn't help either.

c:\Users\Mark\Cash\Python**2to3.py

Traceback (most recent call last):
   File C:\Python33\Tools\Scripts\**2to3.py, line 3, in module
 from lib2to3.main import main
ImportError: No module named main



Perhaps you have a sys.path conflict?


Correct, now fixed, thanks.



Use functools.cmp_to_key for porting cmp functions.  sort(x, my_cmp)
becomes sort(x, key=cmp_to_key(my_cmp))

The cmp builtin is also gone.  If you need it, the suggested replacement
for cmp(a, b) is (b  a) - (a  b).


As it's my own small code base I've blown away all references to cmp, 
it's rich comparisons all the way.




Cheers,
Ian



--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: datetime issue

2012-10-31 Thread Mark Lawrence

On 01/11/2012 00:23, Robert Miles wrote:

On 10/31/2012 4:38 PM, Mark Lawrence wrote:

On 31/10/2012 19:35, ru...@yahoo.com wrote:

On 10/31/2012 09:11 AM, Grant Edwards wrote: On 2012-09-16, 
?? nikos.gr...@gmail.com wrote:.

Broken?  Yes.  But so is every piece of software in one way
or another.  Thunderbird is one of the most perpetually buggy
pierces of software I have ever used on a continuing basis



Please provide evidence that Thunderbird is buggy.  I use it quite
happily, don't have problems, and have never seen anybody complaining
about it.


Why should they complain about it in this newsgroup?


I'm reading all the Python *MAILING LISTS* that I'm interested in with 
Thunderbird.  Here.  Now.  So do a lot of other people.  If they weren't 
happy with it, they'd be stating so here when this type of discussion 
came up.


--
Cheers.

Mark Lawrence.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python garbage collector/memory manager behaving strangely

2012-10-31 Thread Robert Miles

On 9/16/2012 9:12 PM, Dave Angel wrote:

On 09/16/2012 09:07 PM, Jadhav, Alok wrote:

Hi Everyone,



I have a simple program which reads a large file containing few million
rows, parses each row (`numpy array`) and converts into an array of
doubles (`python array`) and later writes into an `hdf5 file`. I repeat
this loop for multiple days. After reading each file, i delete all the
objects and call garbage collector.  When I run the program, First day
is parsed without any error but on the second day i get `MemoryError`. I
monitored the memory usage of my program, during first day of parsing,
memory usage is around **1.5 GB**. When the first day parsing is
finished, memory usage goes down to **50 MB**. Now when 2nd day starts
and i try to read the lines from the file I get `MemoryError`. Following
is the output of the program.


Is it a 32-bit program?  If so, expect the maximum amount of memory it
can use to hold the program, its current dataspace, and images of all
the files it has open to be about 3.5 GB, even if it is running on a
64-bit computer with over 4 GB of memory.  It seems that 32-bit
addresses can only refer to 4 GB of memory, and part of that 4 GB
must be used for whatever the operating system needs for running
32-bit programs.  With some of the older compilers, only 2 GB can be
used for the program; the other 2 GB is reserved for the operating system.

How practical would it be to have that program run twice a day?
The first time, it should ignore all the data for the second half
of the day; the second time, it should ignore all the data for the
first half of the day.

--
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Chris Angelico
On Thu, Nov 1, 2012 at 10:44 AM, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 On the contrary. If you are using cmp with sort, your sorts are slow, and
 you should upgrade to using a key function as soon as possible.


But cmp_to_key doesn't actually improve anything. So I'm not sure how
Py3 has achieved anything; Py2 supported key-based sorting already.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: sort order for strings of digits

2012-10-31 Thread Arnaud Delobelle
On 31 October 2012 23:09, Steven D'Aprano
steve+comp.lang.pyt...@pearwood.info wrote:
 The trick is to take each string and split it into a leading number and a
 trailing alphanumeric string. Either part may be empty. Here's a pure
 Python solution:

 from sys import maxsize  # use maxint in Python 2
 def split(s):
 for i, c in enumerate(s):
 if not c.isdigit():
 break
 else:  # aligned with the FOR, not the IF
 return (int(s), '')
 return (int(s[:i] or maxsize), s[i:])

 Now sort using this as a key function:

 py L = ['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
 py sorted(L, key=split)
 ['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']

You don't actually need to split the string, it's enough to return a
pair consisting of the number of leading digits followed by the string
as the key. Here's an implementation using takewhile:

 from itertools import takewhile
 def prefix(s):
... return sum(1 for c in takewhile(str.isdigit, s)) or 1000, s
...
 L = ['9', '1000', 'abc2', '55', '1', 'abc', '55a', '1a']
 sorted(L, key=prefix)
['1', '1a', '9', '55', '55a', '1000', 'abc', 'abc2']

Here's why it works:

 map(prefix, L)
[(1, '9'), (4, '1000'), (1000, 'abc2'), (2, '55'), (1, '1'), (1000,
'abc'), (2, '55a'), (1, '1a')]

-- 
Arnaud
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Negative array indicies and slice()

2012-10-31 Thread Andrew Robinson

On 10/31/2012 02:20 PM, Ian Kelly wrote:

On Wed, Oct 31, 2012 at 7:42 AM, Andrew Robinson wrote:

Then; I'd note:  The non-goofy purpose of slice is to hold three
data values;  They are either numbers or None.  These *normally*
encountered values can't create a memory loop.
So, FOR AS LONG, as the object representing slice does not contain
an explicit GC pair; I move that we mandate (yes, in the current
python implementation, even as a *fix*) that its named members may
not be assigned any objects other than None or numbers

eg: Lists would be forbidden

Since functions, and subclasses, can be test evaluated by int(
the_thing_to_try ) and *[] can too,
generality need not be lost for generating nothing or numbers.


PEP 357 requires that anything implementing the __index__ special 
method be allowed for slicing sequences (and also that __index__ be 
used for the conversion).  For the most part, that includes ints and 
numpy integer types, but other code could be doing esoteric things 
with it.


I missed something... (but then that's why we're still talking about it...)

Reading the PEP, it notes that *only* integers (or longs) are permitted 
in slice syntax.

(Overlooking None, of course... which is strange...)

The PEP gives the only exceptions as objects with method __index__.

Automatically, then, an empty list is forbidden (in slice syntax).
However,  What you did, was circumvent the PEP by passing an empty list 
directly to slice(), and avoiding running it through slice syntax 
processing.


So...
Is there documentation suggesting that a slice object is meant to be 
used to hold anything other than what comes from processing a valid 
slice syntax [::]??. (we know it can be done, but that's a different Q.)



The change would be backward-incompatible in any case, since there is 
certainly code out there that uses non-numeric slices -- one example 
has already been given in this thread.

Hmmm.

Now, I'm thinking -- The purpose of index(), specifically, is to notify 
when something which is not an integer may be used as an index;  You've 
helpfully noted that index() also *converts* those objects into numbers.


Ethan Fullman mentioned that he used the names of fields, instead of 
having to remember the _offsets_; Which means that his values _do 
convert_ to offset numbers


His example was actually given in slice syntax notation [::].
Hence, his objects must have an index() method, correct?.

Therefore, I still see no reason why it is permissible to assign 
non-numerical (non None) items
as an element of slice().  Or, let me re-word that more clearly -- I see 
no reason that slice named members when used as originally intended 
would ever need to be assigned a value which is not *already* converted 
to a number by index().  By definition, if it can't be coerced, it isn't 
a number.


A side note:
At 80% less overhead, and three slots -- slice is rather attractive to 
store RGB values in for a picture!  But, I don't think anyone would have 
a problem saying No, we won't support that, even if you do do it!


So, what's the psychology behind allowing slice() to hold objects which 
are not converted to ints/longs in the first place?


-- 
http://mail.python.org/mailman/listinfo/python-list


how to perform word sense disambiguation?

2012-10-31 Thread nachiket
an initial part of my project involves assigning sense to each word in 
sentence. I came across this tool called wordnet. do share your views
-- 
http://mail.python.org/mailman/listinfo/python-list


[issue16365] IDLE for Windows 8

2012-10-31 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Unfortunately, there is not much to check now that you got it working. Doing 
what Roger first asked for might have given insights, but we can now not 
determine the issue anymore.

So closing this as works for me.

--
nosy: +loewis
resolution:  - works for me
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16365
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16362] _LegalCharsPatt in cookies.py includes illegal characters

2012-10-31 Thread Simon Blanchard

Simon Blanchard added the comment:

'HTTP_USER_AGENT': 'Mozilla/5.0 (compatible; Baiduspider/2.0; 
+http://www.baidu.com/search/spider.html)',

It's the Baidu spider according to the user agent string. (Baidu is the biggest 
search engine in China.) The serving app is Django + mod_wsgi + Apache - which 
I think must be OK. I guess the Baidu spider is broken?

Thanks

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16362
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue7317] Display full tracebacks when an error occurs asynchronously

2012-10-31 Thread alon horev

alon horev added the comment:

Hi Antoine, can you please have a look at the patch? It's been over a year 
since it's submitted. (-: thanks!

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7317
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16370] Regarding embedding Python in Another Application

2012-10-31 Thread Andrew Svetlov

New submission from Andrew Svetlov:

On Fri, Oct 26, 2012 at 12:02 AM, Tom Epperly epper...@llnl.gov wrote:
Regarding this section, 
http://docs.python.org/extending/embedding.html#very-high-level-embedding, 
according to http://docs.python.org/c-api/init.html Py_SetProgramName() should 
be called before Py_Initialize() (see the comment for Py_SetProgramName()). 
This matters for the particular case of Mac OS X (see 
http://mail.python.org/pipermail/pythonmac-sig/2012-October/023746.html).

I recommend adding a Py_SetProgramName() to the example.

Regards,

Tom Epperly

--
assignee: docs@python
components: Documentation
keywords: easy
messages: 174269
nosy: asvetlov, docs@python
priority: normal
severity: normal
status: open
title: Regarding embedding Python in Another Application
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16370] Regarding embedding Python in Another Application

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Patch for 2.7 applied, the same text should be for 3.2+

Chris, please check my wording as native English speaker.

--
keywords: +patch
nosy: +chris.jerdonek
Added file: http://bugs.python.org/file27805/issue16370.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13598] string.Formatter doesn't support empty curly braces {}

2012-10-31 Thread Phil Elson

Changes by Phil Elson pelson@gmail.com:


--
nosy: +pelson

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13598
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16197] Several small errors in winreg documentation

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Not sure consolidating is good idea, ok with other changes.

--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13598] string.Formatter doesn't support empty curly braces {}

2012-10-31 Thread Phil Elson

Phil Elson added the comment:

The current patch fails to catch the fact that auto vs manual numbering has 
been used in following corner case:

from string import Formatter
print(Formatter().format({0:{}}, 'foo', 5))


To fix this, without adding state to the formatter instance, some more 
information is going to need to be passed to the _vformat method.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13598
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue6829] Frendly error message when inheriting from function

2012-10-31 Thread Yongzhi Pan

Changes by Yongzhi Pan fossi...@users.sourceforge.net:


--
nosy: +fossilet

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6829
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I updated the patch to resolve the conflict with issue14625.

--
Added file: http://bugs.python.org/file27806/codecs_writer_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file27807/codecs_writer_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Removed file: http://bugs.python.org/file27806/codecs_writer_2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


Added file: http://bugs.python.org/file27808/decodebench.res

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16370] Regarding embedding Python in Another Application

2012-10-31 Thread Matt Jones

Matt Jones added the comment:

Andrew, below is a revision of your comment with a few corrections made by a 
native english speaker.


Function :c:func:`Py_SetProgramName` should be called before 
:c:func:`Py_Initialize` to inform the interpreter about paths to Python 
run-time libraries.  Next initialize the Python interpreter with 
:c:func:`Py_Initialize`, followed by the execution of a hard-coded Python 
script that prints the date and time.  Afterwards, the :c:func:`Py_Finalize` 
call shuts the interpreter down, followed by the end of the program.  In a real 
program, you may want to get the Python script from another source, perhaps a 
text-editor routine, a file, or a database.  Getting the Python code from a 
file can better be done by using the :c:func:`PyRun_SimpleFile` function, which 
saves you the trouble of allocating memory space and loading the file contents.

--
nosy: +Matt.Jones

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

With the patch UTF-8 decoder 20% slower for some data. UTF-16 decoder 20% 
faster for some data and 20% slower for other data. UTF-32 decoder slower for 
many data (even after some optimization, naive code was up to 50% slower). 
Standard charmap decoder 10% slower. Only UTF-7, unicode-escape and 
raw-unicode-escape have become much faster (unicode-escape and 
raw-unicode-escape as with issue16334 patch).

A well optimized decoders do not benefit from the _PyUnicodeWriter, only a 
slight slowdown. The patch requires some optimization (as for UTF-32 decoder) 
to reduce the negative effect. Non-optimized decoders will receive the great 
benefit.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16371] typo in ctypes

2012-10-31 Thread George Yoshida

New submission from George Yoshida:

In the following sentence:

http://docs.python.org/3.3/library/ctypes.html
 16.17.1.19. Surprises
 There are some edges in ctypes where you may be expect something else than 
 what actually happens.

you may be expect should read you may expect

--
assignee: docs@python
components: Documentation
messages: 174276
nosy: docs@python, quiver
priority: low
severity: normal
status: open
title: typo in ctypes

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16370] Regarding embedding Python in Another Application

2012-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6e24eb832fb2 by Andrew Svetlov in branch '2.7':
Issue #16370: Mention Py_SetProgramName in example for very high level 
embedding.
http://hg.python.org/cpython/rev/6e24eb832fb2

New changeset 4c35f5ec6acf by Andrew Svetlov in branch '3.2':
Issue #16370: Mention Py_SetProgramName in example for very high level 
embedding.
http://hg.python.org/cpython/rev/4c35f5ec6acf

New changeset b6a5f54e0a34 by Andrew Svetlov in branch '3.3':
Merge issue #16370: Mention Py_SetProgramName in example for very high level 
embedding.
http://hg.python.org/cpython/rev/b6a5f54e0a34

New changeset 0c1b81465d9c by Andrew Svetlov in branch 'default':
Merge issue #16370: Mention Py_SetProgramName in example for very high level 
embedding.
http://hg.python.org/cpython/rev/0c1b81465d9c

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16370] Mention Py_SetProgramName in example for very high level embedding

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks, Matt!

--
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
title: Regarding embedding Python in Another Application - Mention 
Py_SetProgramName in example for very high level embedding
type:  - enhancement

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16370
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16197] Several small errors in winreg documentation

2012-10-31 Thread Zachary Ware

Zachary Ware added the comment:

The thought on consolidating is to match Doc/library/msvcrt.rst which does the 
same thing.  Also, when I started reading this page shortly before opening this 
issue, I was reading most of the page at once and was frankly pretty annoyed by 
seeing the same notice over and over.  Although I could see the point of having 
a much shorter blurb on each affected function in addition to an explanatory 
note at the top.  So instead of

'''
   .. versionchanged:: 3.3
  This function used to raise a :exc:`WindowsError`, which is now an
  alias of :exc:`OSError`.
'''

on each one, something like

'''
   .. versionchanged:: 3.3
  :exc:`WindowsError` is :exc:`OSError`
'''

perhaps?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16372] Initialization strange behavior

2012-10-31 Thread Wojciech Danilo

New submission from Wojciech Danilo:

Hi!
I'm using Python for several years and now I'm writing in Python 3 for the 
first time. I think I found a strange bug in it. Lets concider the code in the 
attachement.
In the 33 line there is construction of new instance of class Result:
print('!!!',Result().value)
what is strange, the class is defined as:
class Result:
def __init__(self, value=[], start=0, end=0):
self.value = value
...

and what I get as a result is:
!!! ['a', 'b']

Where the array was somehow magically stored from previous initialization (take 
a look at the code for full listing).

--
components: Interpreter Core
files: test.py
messages: 174280
nosy: wdanilo
priority: normal
severity: normal
status: open
title: Initialization strange behavior
versions: Python 3.3
Added file: http://bugs.python.org/file27809/test.py

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16372
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16371] typo in ctypes

2012-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset ee13dc0793df by Andrew Svetlov in branch '3.2':
Issue #16371: fix typo in ctypes documentation.
http://hg.python.org/cpython/rev/ee13dc0793df

New changeset 8badb59fd35e by Andrew Svetlov in branch '3.3':
Merge issue #16371: fix typo in ctypes documentation.
http://hg.python.org/cpython/rev/8badb59fd35e

New changeset 0dac3e07ee8b by Andrew Svetlov in branch 'default':
Merge issue #16371: fix typo in ctypes documentation.
http://hg.python.org/cpython/rev/0dac3e07ee8b

--
nosy: +python-dev

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13598] string.Formatter doesn't support empty curly braces {}

2012-10-31 Thread Phil Elson

Phil Elson added the comment:

Ramchandra's fix looks fairly good, although there is at least one remaining 
issue (see my last comment). I have attached a patch which addresses (and 
tests) this.

I'd be happy to pick this up if there are any remaining issues that need to be 
addressed, otherwise: I hope this helps.

Thanks,

--
Added file: http://bugs.python.org/file27810/pelson_issue13598.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13598
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16372] Initialization strange behavior

2012-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

This is a feature, not a bug. :-)  See 

http://docs.python.org/2/faq/design.html#why-are-default-values-shared-between-objects

for more information.

--
nosy: +mark.dickinson
resolution:  - invalid
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16372
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16372] Initialization strange behavior

2012-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Actually, since you're using Python 3, I should have linked to the Python 3 
documentation.  Try this one:

http://docs.python.org/3/faq/design.html#why-are-default-values-shared-between-objects

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16372
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16371] typo in ctypes

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks, George.

--
nosy: +asvetlov
resolution:  - fixed
stage:  - committed/rejected
status: open - closed
type:  - enhancement
versions: +Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16373] Recursion error comparing set() and MutableMapping.keys()

2012-10-31 Thread Nick Coghlan

New submission from Nick Coghlan:

Try these in 3.3 (or Python 3.2 for the latter):

set()  collections.ChainMap().keys()
set()  collections.UserDict().keys()

Both fail with max recursion depth exceeded.

Given that both exhibit this behaviour, the core of the problem is quite 
possibly in MutableMapping.

(Uncovered while attempting to find a tidier ChainMap-based way to implement 
__subclasshook__ checks for ducktyping based on multiple methods)

--
messages: 174286
nosy: ncoghlan
priority: normal
severity: normal
status: open
title: Recursion error comparing set() and MutableMapping.keys()
versions: Python 3.2, Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16371] typo in ctypes

2012-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f0b22e314975 by R David Murray in branch '3.2':
#16371: fix up the English a bit more.
http://hg.python.org/cpython/rev/f0b22e314975

New changeset 85504242d0ce by R David Murray in branch '3.3':
merge #16371: fix up the English a bit more.
http://hg.python.org/cpython/rev/85504242d0ce

New changeset f5dec8c57715 by R David Murray in branch 'default':
merge #16371: fix up the English a bit more.
http://hg.python.org/cpython/rev/f5dec8c57715

New changeset fa959dc5c61d by R David Murray in branch '2.7':
#16371: fix up the English.
http://hg.python.org/cpython/rev/fa959dc5c61d

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16374] ConfigParser: Passing a semicolon as a value

2012-10-31 Thread Daniel Gordon

New submission from Daniel Gordon:

I have a configuration file containing a key and value:
delimiter=;

Using ConfigParser,
the resulting value of the key delimiter is empty.
Expected behavior should be a semicolon as the value.

This behavior occurred on Linux (Ubuntu 12.04) but not on Windows 7.

--
components: Library (Lib)
messages: 174288
nosy: Daniel.Gordon
priority: normal
severity: normal
status: open
title: ConfigParser: Passing a semicolon as a value
type: behavior
versions: Python 2.7

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16197] Several small errors in winreg documentation

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

What's about compromise from attached file?

--
Added file: http://bugs.python.org/file27811/winreg_3.3+v2.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16371] typo in ctypes

2012-10-31 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Thanks, David.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16371
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16197] Several small errors in winreg documentation

2012-10-31 Thread Zachary Ware

Zachary Ware added the comment:

Not bad, but with that scheme we could even go as far as cutting out the 
'WindowsError is OSError' bit and make it just 


   ..versionchanged:: 3.3
 See :ref:`above exception-changed`.


--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16197
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16375] Warning in Parser/grammar1.c

2012-10-31 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

The changeset 7e0e15d9957f causes annoying GCC warning in Parser/grammar1.c.

Possible solutions:

1. Revert this changes back.
2. Prohibit this type of warnings by the compiler flags.
3. Explicitly cast _PyParser_TokenNames to char * in PyGrammar_LabelRepr().
4. Make PyGrammar_LabelRepr() returns const char *.

--
components: Interpreter Core
messages: 174292
nosy: benjamin.peterson, serhiy.storchaka
priority: normal
severity: normal
stage: needs patch
status: open
title: Warning in Parser/grammar1.c
type: compile error
versions: Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16375
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16311] Use _PyUnicodeWriter API in text decoders

2012-10-31 Thread STINNER Victor

STINNER Victor added the comment:

I ran decodebench.py and bench-diff.py scripts from #14624, I just
replaced repeat=10 with repeat=100 to get more reliable numbers. I
only see some performance regressions between -5% and -1%, but there
are some speedup on UTF-8 and UTF-32 (between +11% and +14%). On a
microbenchmark, numbers in the -10..10% range just means no change.

Using _PyUnicodeWriter should not change anything to performances on
valid data, only performances of handling decoding errors between the
overallocation factor is different, the code to widen the buffer and
the code to write replacement characters.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16311
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16373] Recursion error comparing set() and MutableMapping.keys()

2012-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Also:

  {}.keys()  collections.UserDict().keys()
  {}.items()  collections.UserDict().keys()
  {}.items()  collections.UserDict().items()
  ...

--
components: +Library (Lib)
nosy: +serhiy.storchaka
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-31 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Bmp
---
sent by an 11-year old

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

buump.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14675
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16373] Recursion error comparing set() and MutableMapping.keys()

2012-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The core of the problem is in Set.

import collections.abc
class S(collections.abc.Set):
def __contains__(self, key): return False
def __iter__(self): return iter(())
def __len__(self): return 0

S()  set() is False.
set()  S() fails.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16344] Traceback Internationalization Proposal

2012-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

 Teach the users English may be an altruist goal in the long term, but
 for many teachers (like my case) it a barrier right now that can tip
 the balance to other more friendly languages

Students are not required to learn English and English grammar before 
programming -- learning a few words is already enough to grasp the meaning of 
many error messages (and it's anyway already necessary for keywords, functions, 
methods, classes, modules, etc.).

 Those that continues working on programming will surely be exposed 
 sooner or later to formal technical English course at University or 
 similar.

The sooner they get exposed to English the better it is.  The best way to learn 
a language is by using it, and IMHO technical English is even easier than 
normal English (and often even than native language).

 But, if they don't continue their studies, or choose a different 
 career, maybe their English skill will never be enough.

I think that nowadays anyone should learn English anyway, and the more you 
translate the more you make their lives difficult, because you confine them to 
a restricted subset of all the available information (this is getting off-topic 
though).

 Here, as you point, translation poses a new perspective, why take
 that as a threat instead of an opportunity to bring better messages?

This is a different problem though.  Python (and programming in general) has 
its own jargon, and the jargon provides a concise way to refer to specific 
concepts (e.g. tuple-unpacking).  While it certainly shouldn't be abused, it's 
often more convenient to use it.  Creating a new localized jargon also doesn't 
help, and it only makes things more complicated.

For example you mentioned the invalid token error message, that on the page 
you linked is translated as token inválido.  AFAIK token is not a Spanish 
word, so either you end up leaving the jargon untranslated, or you translated 
in something that doesn't make much sense and doesn't match with other names 
(e.g. the tokenize module).
While improving the message is a good idea (if/when possible), translating it 
doesn't make things much better.

 localized error messages could eventually produce better search
 results for non-English speakers if there is enough material written
 in they language. 

IME experience it's the opposite.  This might work a bit better for widespread 
languages like Spanish, but otherwise I often come across to fairly bad 
results.  First of all localized documentations are not as updated as the 
official one (that gets updated daily), and the translation might not be 
accurate.  Given that the English community is the biggest one, it's also 
easier to find answers in English than it is in any other language.  People 
that are not using English resources are often inexperienced users, and the 
solutions they provide are not always good (of course there are exceptions).

 At least some part should be translated too, as for example, the 
 Python Tutorial was translated by the local community to Spanish:
 http://docs.python.org.ar/tutorial/contenido.html

But this is just a part, has not been updated in over 2 years, and doesn't even 
cover Python 3.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16344
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

It is possible with this bug to make a sudo IDLE edit a root-file.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16248
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

oops ignore last msg

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16248
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16373] Recursion error comparing set() and MutableMapping.keys()

2012-10-31 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Related (if not superseder) issue is issue8743.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16373
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue8743] set() operators don't work with collections.Set instances

2012-10-31 Thread Serhiy Storchaka

Changes by Serhiy Storchaka storch...@gmail.com:


--
nosy: +serhiy.storchaka
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8743
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

Can you provide a patch?

--
nosy: +ezio.melotti
stage:  - needs patch
type:  - enhancement
versions: +Python 3.4 -Python 3.2, Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

I'll give one now.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Do you think this should be fixed - the comments say
This module is currently Py2.3 compatible and should be kept that way unless a 
major compelling advantage arises.  IOW, 2.3 compatibility is strongly 
preferred, but not guaranteed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16136] Removal of VMS support

2012-10-31 Thread Sandeep Mathew

Sandeep Mathew added the comment:

I have asked HP for access to a VMS box so that I restart my work. I initially 
checked with the university to see if I can get hold of an Itanium box. 

@Trent : If you have HP - UX already running, you may make use of Hyper-V to 
get vms running without changing the existing the HP-UX installation.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16136
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16374] ConfigParser: Passing a semicolon as a value

2012-10-31 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
nosy: +lukasz.langa

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16374
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16259] Replace exec() in test.regrtest with __import__

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Bump.

--
type:  - behavior
versions: +Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16259
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

It seems fine to me to change it for 3.4, assuming that the diff isn't huge.  
Spec updates don't seem likely, and even if they did occur I'd expect them to 
be small tweaks rather than major additions.

+0 from me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ezio Melotti

Ezio Melotti added the comment:

That might be true for 2.7, but for 3.4 it can probably be changed.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

BTW, in an earlier comment you said: now threading imports dummy_threading 
when threading is not available.

Do you mean that 'import threading' will always succeed, even on platforms 
built without thread support?  Is this documented somewhere?

The docs at http://docs.python.org/3.3/library/dummy_threading.html seem to say 
rather that dummy_threading still has to be imported explicitly.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-31 Thread Roundup Robot

Roundup Robot added the comment:

New changeset abe8a2908f08 by Jesus Cea in branch '2.7':
Closes #16369: Global PyTypeObjects not initialized with PyType_Ready(...). 
DOCUMENT IT!
http://hg.python.org/cpython/rev/abe8a2908f08

New changeset e9ea7f6a7107 by Jesus Cea in branch '3.2':
Closes #16369: Global PyTypeObjects not initialized with PyType_Ready(...). 
DOCUMENT IT!
http://hg.python.org/cpython/rev/e9ea7f6a7107

New changeset 9a4e2d394ba0 by Jesus Cea in branch '3.3':
MERGE: Closes #16369: Global PyTypeObjects not initialized with 
PyType_Ready(...). DOCUMENT IT!
http://hg.python.org/cpython/rev/9a4e2d394ba0

New changeset e5f39546989f by Jesus Cea in branch 'default':
MERGE: Closes #16369: Global PyTypeObjects not initialized with 
PyType_Ready(...). DOCUMENT IT!
http://hg.python.org/cpython/rev/e5f39546989f

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-31 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Benjamin, 3.3/3.4 PyDictDummy_Type initialization is missing too. That code 
was introduced in 


changeset:   76485:6e5855854a2e
user:Benjamin Peterson benja...@python.org
date:Mon Apr 23 11:24:50 2012 -0400
summary: Implement PEP 412: Key-sharing dictionaries (closes #13903)


Reopening and assigning to you :-) (if you don't want to work on this, let me 
know)

--
assignee:  - benjamin.peterson
nosy: +benjamin.peterson
resolution: fixed - 
status: closed - open
versions: +Python 2.7, Python 3.2, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue14675] make distutils.ccompiler.CCompiler an abstract class

2012-10-31 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
resolution:  - wont fix
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14675
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Is there an equivalent of _dummy_thread for threading?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16268] dir(closure) does not find __dir__

2012-10-31 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16268
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Ignore earlier message.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

@Mark
BTW, in an earlier comment you said: now threading imports dummy_threading 
when threading is not available.
My comment only applies to _thread.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-10-31 Thread Guilherme Polo

Guilherme Polo added the comment:

I can ignore it, but let us be honest. If you got sudo privilege already, why 
are you bothering to break (or whatever else) the system using IDLE ? The issue 
here did not give you the sudo privilege. If it did, then we have an actual 
security bug.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16248
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-31 Thread Jesús Cea Avión

Jesús Cea Avión added the comment:

Any option of having a test?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Sorry it doesn't apply to anything at all.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

Odd.. I download decimal.py from 
http://hg.python.org/cpython/file/fa959dc5c61d/Lib/decimal.py but it uses 1L 
(isn't py3k compliant)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16248] Security bug in tkinter allows for untrusted, arbitrary code execution.

2012-10-31 Thread Ramchandra Apte

Ramchandra Apte added the comment:

I think this is a legitimate security bug.
the malicious program needs to create a file with a certain name in the home 
dir.
If a user runs say IDLE (or another tk app) with root priveleges using sudo, 
the file will be run with root priveleges.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16248
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue16369] Global PyTypeObjects not initialized with PyType_Ready(...)

2012-10-31 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16369
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13701] Remove Decimal Python 2.3 Compatibility

2012-10-31 Thread Mark Dickinson

Mark Dickinson added the comment:

Revision fa959dc5c61d comes from the 2.7 maintenance branch.  Try:

   http://hg.python.org/cpython/file/e5f39546989f/Lib/decimal.py

instead.  Better still, get a clone of the Python repository. :-)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13701
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



  1   2   >