[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-20 Thread STINNER Victor

STINNER Victor added the comment:

I modified my patch to address Serhiy's comments. Thanks for the your review 
Serhiy.

changeset:   101442:779563dd701c
tag: tip
user:Victor Stinner 
date:Fri May 20 11:36:13 2016 +0200
files:   Python/import.c
description:
Cleanup import.c

* Replace PyUnicode_RPartition() with PyUnicode_FindChar() and
  PyUnicode_Substring() to avoid the creation of a temporary tuple.
* Use PyUnicode_FromFormat() to build a string and avoid the single_dot ('.')
  singleton

Thanks Serhiy Storchaka for your review.

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread Nick Coghlan

Nick Coghlan added the comment:

No objections from me (and I don't have anything to add to Serhiy's comments on 
the code review)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM, but I left a couple of minor suggestions on Rietveld. I hope they can 
make the code yet cleaner.

--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26948] Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of str.partition/rpartition

2016-05-04 Thread STINNER Victor

New submission from STINNER Victor:

Attached patch simplifies PyImport_ImportModuleLevelObject to avoid the 
temporary tuple created by str.partition/rpartition(). I don't expect any 
difference on the performance, it's more to cleanup the code.

--
files: import.patch
keywords: patch
messages: 264809
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Simplify PyImport_ImportModuleLevelObject: avoid temporary tuple of 
str.partition/rpartition
type: performance
versions: Python 3.6
Added file: http://bugs.python.org/file42714/import.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com