New submission from py.user :
http://docs.python.org/py3k/library/stdtypes.html#str.join
str.join(iterable)¶
Return a string which is the concatenation of the strings in the iterable
iterable. A TypeError will be raised if there are any non-string values in seq,
including bytes objects
New submission from py.user :
http://docs.python.org/py3k/library/stdtypes.html#str.ljust
str.ljust(width[, fillchar])¶
Return the string left justified in a string of length width. Padding is
done using the specified fillchar (default is a space). The original string is
returned if
py.user added the comment:
str.zfill also
--
___
Python tracker
<http://bugs.python.org/issue13754>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from py.user :
>>> 'abcd'.endswith(['a', 'b'])
Traceback (most recent call last):
File "", line 1, in
TypeError: Can't convert 'list' object to str implicitly
>>>
it would be nice like in str.join
>&
New submission from py.user :
specification says
[code]
str.count(sub[, start[, end]])
Return the number of non-overlapping occurrences of substring sub in the
range [start, end]. Optional arguments start and end are interpreted as in
slice notation.
[/code]
[code]
>>> '
New submission from py.user :
specification
1)
str.upper()¶
Return a copy of the string converted to uppercase.
2)
str.isupper()¶
Return true if all cased characters in the string are uppercase and there
is at least one cased character, false otherwise. Cased characters are those
New submission from py.user :
specification
str.capitalize()¶
Return a copy of the string with its first character capitalized and the
rest lowercased.
>>> '\u1ffc', '\u1ff3'
('ῼ', 'ῳ')
>>> '\u1ffc'.isupper()
False
py.user added the comment:
in http://bugs.python.org/issue12204
Marc-Andre Lemburg wrote:
I suggest to close this ticket as invalid or to add a note
to the documentation explaining how the mapping is applied
(and when not).
this problem is another
str.capitalize makes the first character big
Changes by py.user :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue12266>
___
___
Python-bugs-list mailing list
Unsubscri
Changes by py.user :
--
title: str.capitalize contradicts -> str.capitalize contradicts oneself
___
Python tracker
<http://bugs.python.org/issue12266>
___
_
New submission from py.user :
>>> bytearray(b'abc').rjust(10, b'*')
bytearray(b'***abc')
>>> bytearray(b'abc').rjust(10, bytearray(b'*'))
Traceback (most recent call last):
File "", line 1, in
TypeErro
Changes by py.user :
--
title: bytearray center, ljust, rjust don't accept a bytearray as the fill
character -> bytearray methods center, ljust, rjust don't accept a bytearray as
the fill character
___
Python tracker
<http:/
New submission from py.user :
>>> bytearray(b'abc').count(bytearray(b''), None)
Traceback (most recent call last):
File "", line 1, in
TypeError: slice indices must be integers or None or have an __index__ method
>>> bytearray(b'abc
py.user added the comment:
all other methods support it and it's right
>>> barr = bytearray(b'abcd*')
>>> barr.center(len(barr) * 4, barr[-1:])
Traceback (most recent call last):
File "", line 1, in
TypeError: must be a byte string of length 1,
New submission from py.user :
help(bytearray.maketrans)
maketrans(...)
B.maketrans(frm, to) -> translation table
Return a translation table (a bytes object of length 256)
suitable for use in bytes.translate where each byte in frm is
mapped to the byte at the same posit
py.user added the comment:
> A bytearray is for working with mutable data. We don't support using > it in
> all places that the non-mutable data types can be used.
>>> bytearray(b'abcd').strip(bytearray(b'da'))
bytearray(b'bc')
>
New submission from py.user :
>>> import string
>>> class MyTemplate(string.Template):
... delimiter = '.'
...
>>> MyTemplate.delimiter = 'x'
>>> mt = MyTemplate('.field xfield')
>>> mt.substitute(field=None)
'N
New submission from py.user :
>>> barr = bytearray(b'abcde')
>>> lst = list('abcde')
>>> barr[::-3] = ()
>>> barr
bytearray(b'acd')
>>> lst[::-3] = ()
Traceback (most recent call last):
File "", line 1, in
py.user added the comment:
> I happen to prefer del myself
> but I agree that the two mutable sequence classes should behave the same.
del is not so flexible as assignement
>>> cmpr = [bytearray(i.encode('ascii')) for i in ('abcd', 'efgh',
py.user added the comment:
the former could be like:
del cmpr[0][::-2], cmpr[1][::2], cmpr[2][1::2]
it's ok
how to implement this with del ?
>>> cmpr
[bytearray(b'abcd'), bytearray(b'efgh'), bytearray(b'ijkl')]
>>> cmpr[0][::-2], cmpr
py.user added the comment:
>>> [c for c in all_chars if c not in L and ...
L ?
--
___
Python tracker
<http://bugs.python.org/issue12266>
___
___
P
New submission from py.user :
1)
4.6.4 Mutable Sequence Types
| s[i:j] = t | slice of s from i to j is replaced |
|| by the contents of the iterable t |
>>> lst = list('abc')
>>> barr = bytearray(b'abc')
>>> lst[:1] = 4
Traceback
New submission from py.user :
4.6.4 Mutable Sequence Types
| s.remove(x) | same as del s[s.index(x)] |
>>> b = bytearray()
>>> b.extend(range(1, 6))
>>> b
bytearray(b'\x01\x02\x03\x04\x05')
>>> b.remove(2)
>>> del b[b.index(2)]
T
Changes by py.user :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue12631>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from py.user :
>>> with open('/etc/passwd') as f1, \
... open('/etc/profile) as f2:
File "", line 2
open('/etc/profile) as f2:
^
SyntaxError: EOL while scanning string literal
>>>
>>
py.user added the comment:
yes, you're right, this is my mistake
--
___
Python tracker
<http://bugs.python.org/issue12685>
___
___
Python-bugs-list m
Changes by py.user :
--
resolution: invalid -> fixed
___
Python tracker
<http://bugs.python.org/issue8555>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from py.user :
>>> import os
>>> m = os
>>> type(m)
>>> isinstance(m, module)
Traceback (most recent call last):
File "", line 1, in
NameError: name 'module' is not defined
>>> n = 1
>>> type(n)
>>
py.user added the comment:
I thought this will put the topic from unresolved to resolved
Now I see this is for bugs only
--
___
Python tracker
<http://bugs.python.org/issue8
py.user added the comment:
Ok, thanks, I thought this is some kind of a bug
--
___
Python tracker
<http://bugs.python.org/issue10275>
___
___
Python-bugs-list m
New submission from py.user :
[gu...@station ~]$ python3
Python 3.1.2 (r312:79147, Apr 28 2010, 11:57:19)
[GCC 4.1.2 20070925 (Red Hat 4.1.2-33)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+2
3
&g
py.user added the comment:
I have downloaded Python today (28 Apr) from the site
I have a version under WinXP (it works fine), but I don't use WinXP
When it told this about _tkinter, I even read the README file and compiled it
with "make test", and there the same thing, i
py.user added the comment:
tryed also:
[r...@station python3.1]# cp /usr/lib/python2.5/lib-dynload/_tkinter.so
lib-dynload
answer is:
Traceback (most recent call last):
File "/home/guest/tmp/code/c/eclipse/pytest/src/main.py", line 4, in
import tkinter
File "/usr/loca
py.user added the comment:
ok, thank you
I found that I have no tcl.h and tk.h
--
___
Python tracker
<http://bugs.python.org/issue8555>
___
___
Python-bugs-list m
py.user added the comment:
allright I installed two -dev packages and ran tkinter
--
___
Python tracker
<http://bugs.python.org/issue8555>
___
___
Python-bug
New submission from py.user :
>>> '{0:d}'.format('a')
Traceback (most recent call last):
File "", line 1, in
ValueError: Unknown format code 'd' for object of type 'str'
>>> '{0:d}'.format(1+1j)
Traceback (most rec
py.user added the comment:
also strange(unobvious) behavior:
>>> '{0:.3s}'.format((i for i in (1, 2, 3)))
'>> '{0:.3s}'.format(range(10))
'ran'
>>> '{0:.3s}'.format(None)
'Non'
>>>
it would be better to pri
py.user added the comment:
R. David Murray wrote:
> it is made clear in various places that every object has an str
here:
http://docs.python.org/py3k/library/string.html#format-specification-mini-language
3rd paragraph:
"A general convention is that an empty format string ("&q
py.user added the comment:
also here:
http://docs.python.org/py3k/library/string.html#format-examples
there is no example with list or tuple to know exactly how they are formatted
--
___
Python tracker
<http://bugs.python.org/issue13
py.user added the comment:
R. David Murray wrote:
> Putting nothing between the {}'s is an empty format string.
this is an empty replacement field
here:
http://docs.python.org/py3k/library/string.html#format-string-syntax
the definition of format string:
"Format strings contain
New submission from py.user :
http://docs.python.org/py3k/library/string.html#format-specification-mini-language
"The fill character can be any character other than ‘{‘ or ‘}’. The presence of
a fill character is signaled by the character following it, which must be one
of the alig
Changes by py.user :
--
components: +Interpreter Core
type: -> behavior
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/issue13811>
___
___
Py
py.user added the comment:
absent fill char and align option:
>>> '{0:10d}'.format(1)
' 1'
>>>
--
___
Python track
py.user added the comment:
Eric V. Smith wrote:
> I'm not sure what you're saying here. Is it that 'xx' should be ignored?
yes, the description says they are assumed absent
--
___
Python tracker
<http://
py.user added the comment:
"If the second character of format_spec is not a valid alignment option, then
it is assumed that both the fill character and the alignment option are absent."
what does it mean ?
--
___
Python trac
py.user added the comment:
Stefan Krah wrote:
> Thus, if fill and align are absent, it does not mean that you can add
arbitrary characters like "xx".
the descriptions says in other words:
"if you have used an incorrect alignment option, then the interpreter behaves
like y
py.user added the comment:
Stefan Krah wrote:
> After it has been established that [[fill]align] is not present you have to
> match the *whole string* with the rest of the grammar
I think, there should be a text in the documentation: "if the alignment optiont
is invalid, it will
New submission from py.user :
help(bytes.strip):
strip(...)
B.strip([bytes]) -> bytes
Strip leading and trailing bytes contained in the argument.
If the argument is omitted, strip trailing ASCII whitespace.
--
assignee: docs@python
components: Documentation
messa
New submission from py.user :
http://docs.python.org/py3k/library/string.html#format-specification-mini-language
The '#' option:
"For floats, complex and Decimal the alternate form causes the result of the
conversion to always contain a decimal-point character, even if no di
Changes by py.user :
--
nosy: +py.user
___
Python tracker
<http://bugs.python.org/issue7098>
___
___
Python-bugs-list mailing list
Unsubscribe:
http://mail.pyth
py.user added the comment:
my question is about the "#" option
it is described as working with Decimal but it doesn't work with Decimal
--
___
Python tracker
<http://bugs.pyt
New submission from py.user :
>>> import re
>>> len(re.search(r'a+', 'a' * 10).group())
10
>>>
>>> re.search(r'a{65536,}', 'a' * 10)
Traceback (most recent call last):
File "/usr/local/lib/python3.2/
New submission from py.user :
>>> import re
>>> '\U0061'
'a'
>>> '\U00100061'
'\U00100061'
>>> re.search('\U00100061', '\U00100061' * 10).group()
'\U00100061'
>>> re.se
New submission from py.user :
>>> import re
>>> re.search(r'(?<=(a|b))(\w+)', 'abc').groups()
('a', 'bc')
>>> re.search(r'(?<=(^))(\w+)', 'abc').groups()
('', 'abc')
>>
New submission from py.user :
This paragraph is redundant
http://docs.python.org/py3k/library/re.html#matching-vs-searching
a duplicate
http://docs.python.org/py3k/library/re.html#search-vs-match
the part about match() behavior in multiline mode could be described in note
here:
http
py.user added the comment:
the multiline mode affects on regex.match()
>>> p = re.compile(r'^a')
>>> p.match('abc\nabc')
<_sre.SRE_Match object at 0xb749bf38>
>>> p.match('abc\nabc').span()
(0, 1)
>>> p.match('
py.user added the comment:
this sentence was deleted:
http://docs.python.org/py3k/library/re.html#matching-vs-searching
"The “match” operation succeeds only if the pattern matches
at the start of the string regardless of mode,
or at the starting position given by the optional pos arg
py.user added the comment:
I won't open another topic:
1)
http://docs.python.org/py3k/library/re.html#regular-expression-syntax
"Most of the standard escapes supported by Python string literals
are also accepted by the regular expression parser:
\a \b \f \n
\r
New submission from py.user :
1)
help(re)
"\s Matches any whitespace character; equivalent to [ \t\n\r\f\v].
\S Matches any non-whitespace character; equiv. to [^
\t\n\r\f\v]."
no info about unicode spaces
2)
help(re.split)
"split(pattern, str
New submission from py.user :
>>> import re
>>> re.search(r'\Ac\Z', 'c')
<_sre.SRE_Match object at 0xb74cff38>
>>> re.search(r'[\A]c[\Z]', 'c')
>>> re.purge()
>>> re.search(r'[\A]c[\Z]',
py.user added the comment:
Martin v. Löwis wrote:
> What behavior would you expect?
I expected similar work
>>> re.search(r'[\s]a', ' a').group()
' a'
>>> re.search(r'[\s]a', 'ba').group()
Traceback (most recent call
Changes by py.user :
--
components: +Regular Expressions
nosy: +ezio.melotti, mrabarnett, py.user
versions: +Python 3.2
___
Python tracker
<http://bugs.python.org/issue14
py.user added the comment:
"+returning a list containing the resulting substrings. If
+capturing parentheses are used in pattern, then the text of all
+groups in the pattern are also returned as part of the resulting
+list."
not only text
>>> import re
&
New submission from py.user :
http://docs.python.org/py3k/library/re.html#re.regex.flags
"or 0 if no flags were provided"
>>> import re
>>> p = re.compile(r'', 0)
>>> p.flags
32
>>>
--
assignee: docs@python
components: Docume
New submission from py.user :
>>> import re
>>> p = re.compile(r'abc')
>>> res = p.search('abcdefabcdef', pos=1, endpos=10)
>>> res = p.match('abcdefabcdef', pos=1, endpos=10)
>>> res = p.findall('abcdefabcdef'
New submission from py.user :
>>> import re
>>> p = re.compile(r'abc(?Pdef)')
>>> p.sub(r'\g', 'abcdef123abcdef')
'def123def'
>>> p.groupindex['n'] = 2
>>> p.sub(r'\g', 'abcdef123abcdef
py.user added the comment:
Matthew Barnett wrote:
> The re module creates the dict purely for the benefit of the user
this dict affects on regex.sub()
>>> import re
>>> p = re.compile(r'abc(?Pdef)')
>>> p.groupindex
{'n': 1}
>>> p.gro
py.user added the comment:
>>> import re
>>> p = re.compile(br'')
>>> p.flags
0
>>>
--
title: regex.flags is never equal to 0 -> for string patterns regex.flags is
never equal to 0
___
P
py.user added the comment:
the first message shows how it can work with a broken dict
Éric Araujo wrote:
> But regex.sub is affected only if you manually muck with the dict, right?
I can get code from anywhere
--
___
Python tracker
&l
New submission from py.user :
http://docs.python.org/py3k/library/re.html#re.match.pos
http://docs.python.org/py3k/library/re.html#re.match.endpos
"which was passed to the search() or match() method of a match object."
http://docs.python.org/py3k/library/re.html#re.match.re
ma
py.user added the comment:
I take someone's code
make tests for its behavior
all tests say "the code is working"
I continue to write the code
make tests for its behavior
all tests say "the code is working"
I install it somewhere and it crashes
now it is dependin
New submission from py.user :
http://docs.python.org/py3k/library/re.html#avoiding-recursion
>>> import sys
>>> sys.getrecursionlimit()
1000
>>> import re
>>> s = 'Begin ' + 1000*'a very long string ' + 'end'
>>> r
New submission from py.user :
http://docs.python.org/py3k/library/re.html#making-a-phonebook
input -> text
--
assignee: docs@python
components: Documentation, Regular Expressions
messages: 156114
nosy: docs@python, ezio.melotti, mrabarnett, py.user
priority: normal
severity: nor
New submission from py.user :
>>> import re
>>> re.search(r'(?<=a){100,200}bc', 'abc', re.DEBUG)
max_repeat 100 200
assert -1
literal 97
literal 98
literal 99
<_sre.SRE_Match object at 0xb7429f38>
>>> re.search(r'(?<
New submission from py.user :
http://docs.python.org/py3k/library/re.html
"Note that patterns which start with positive lookbehind assertions will never
match at the beginning of the string being searched; you will most likely want
to use the search() function rather than the match() fun
New submission from py.user :
http://docs.python.org/py3k/library/re.html
"(?P...)
Similar to regular parentheses, but the substring matched by the group is
accessible within the rest of the regular expression via the symbolic group
name name. Group names must be valid Python identi
py.user added the comment:
testing new e-mail
--
___
Python tracker
<http://bugs.python.org/issue8555>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by py.user :
--
title: re: Docstring for \s and \S don’t mention Unicode -> re: Docstring for
\s and \S doesn’t mention Unicode
___
Python tracker
<http://bugs.python.org/issu
New submission from py.user :
http://docs.python.org/py3k/library/re.html#simulating-scanf
0[xX][\dA-Fa-f]+ -> (0[xX])?[\dA-Fa-f]+
--
assignee: docs@python
components: Documentation, Regular Expressions
messages: 157711
nosy: docs@python, ezio.melotti, mrabarnett, py.user
prior
py.user added the comment:
the prefix "0x" is not necessary for the %x specifier in C
if the pattern will see "ABC", it will not match with it, but it should match
--
___
Python tracker
<http://bug
py.user added the comment:
#include
int main(void)
{
unsigned n;
scanf("%x", &n);
printf("%u\n", n);
return 0;
}
[guest@localhost c]$ .ansi t.c -o t
[guest@localhost c]$ ./t
0xa
10
[guest@localhost c]$ ./t
a
10
[guest@localhost c]$
[guest@localho
py.user added the comment:
the same problem in the %o analog
valid strings for the %x specifier of scanf():
"+0xabc"
"-0xabc"
"+abc"
"-abc"
valid strings for the %o specifier of scanf():
"+0123"
"-0123"
"+123"
"-123&qu
py.user added the comment:
@Cheryl Sabella, I guess Manjusaka has done it already and this looks fine.
--
___
Python tracker
<https://bugs.python.org/issue28
py.user added the comment:
@Karthikeyan Singaravelan
Thank you for the point. I added a new patch.
--
Added file: https://bugs.python.org/file48245/argparse_sys-argv-0-basename.diff
___
Python tracker
<https://bugs.python.org/issue27
Change by py.user :
--
pull_requests: +12642
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue27992>
___
___
Python-bugs-list mai
New submission from py.user:
[guest@localhost ~]$ python3
Python 3.3.0 (default, Sep 29 2012, 22:07:38)
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> license()
Se
New submission from py.user:
http://docs.python.org/3/library/itertools.html#itertools.count
"itertools.count(start=0, step=1)
Make an iterator that returns evenly spaced values starting with n."
starting with start
--
assignee: docs@python
components: Documentation
files: i
Changes by py.user :
Added file: http://bugs.python.org/file30597/issue18218.patch
___
Python tracker
<http://bugs.python.org/issue18218>
___
___
Python-bugs-list mailin
Changes by py.user :
Removed file: http://bugs.python.org/file30596/issue18218.patch
___
Python tracker
<http://bugs.python.org/issue18218>
___
___
Python-bugs-list mailin
New submission from py.user:
http://docs.python.org/3/library/itertools.html#itertools.islice
" itertools.islice(iterable, stop)
itertools.islice(iterable, start, stop[, step])"
>>> print(itertools.islice.__doc__)
islice(iterable, [start,] stop [, step]
py.user added the comment:
same thing with range():
http://docs.python.org/3/library/stdtypes.html?highlight=range#range
http://docs.python.org/3//library/functions.html#func-range
and with slice():
http://docs.python.org/3/library/functions.html?highlight=slice#slice
http://docs.python.org/3
Changes by py.user :
Added file: http://bugs.python.org/file30616/issue18220.patch
___
Python tracker
<http://bugs.python.org/issue18220>
___
___
Python-bugs-list mailin
Changes by py.user :
Removed file: http://bugs.python.org/file30599/issue18220.patch
___
Python tracker
<http://bugs.python.org/issue18220>
___
___
Python-bugs-list mailin
py.user added the comment:
range and slice are normal in python3.4
--
___
Python tracker
<http://bugs.python.org/issue18220>
___
___
Python-bugs-list mailin
New submission from py.user:
>>> print(itertools.__doc__)
Functional tools for creating and using iterators.
Infinite iterators:
count([n]) --> n, n+1, n+2, ...
...
--
assignee: docs@python
components: Documentation, Library (Lib)
files: issue.patch
keywords: patch
mess
New submission from py.user:
http://en.wiktionary.org/wiki/data
"data (uncountable) or plural noun"
--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191354
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
New submission from py.user:
have a git repository:
http://docs.python.org/devguide/faq.html#i-already-know-how-to-use-git-can-i-use-that-instead
git clone git://github.com/akheron/cpython
after running tests by "make test" they created some files in "Lib/test/data/"
[gue
New submission from py.user:
>>> object
>>>
--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191384
nosy: docs@python, py.user
priority: normal
severity: normal
status: open
title: In itertools.repeat() object sha
New submission from py.user:
http://docs.python.org/3/library/itertools.html#itertools-recipes
"Like __builtin__.iter(func, sentinel)"
--
assignee: docs@python
components: Documentation
files: issue.diff
keywords: patch
messages: 191530
nosy: docs@python, py.user
priori
py.user added the comment:
[guest@localhost cpython]$ ./python
Python 3.4.0a0 (default, Jun 22 2013, 04:24:17)
[GCC 4.7.2 20121109 (Red Hat 4.7.2-8)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
>>&g
1 - 100 of 200 matches
Mail list logo