Rocco Moretti wrote:
Pierre Barbier de Reuille wrote:
Please, note that I am entirely open for every points on this proposal
(which I do not dare yet to call PEP).
I still don't see why you can't just use strings.
As does Guido.
Reinhold
--
[EMAIL PROTECTED] wrote:
Tom Anderson:
And we're halfway to looking like perl already! Perhaps a more pythonic
thing would be to define a then operator:
all_lines = file1 then file2 then file3
Or a chain one:
all_lines = file1 chain file2 chain file3
That's certainly not better than the
Ron Adam wrote:
It will be
A if B else (C if D else F)
So this evaluates as if there are parentheses around each section.. Hmm?
(A) if (B) else ( (C) if (D) else (F) )
The first 'if' divided the expr, then each succeeding 'if' divides the
sub expressions, etc... ?
So ...
Erik Max Francis wrote:
Dave Benjamin wrote:
Hooray! After years of arguing over which syntax to use, and finally
giving up since nobody could agree, the Benevolent Dictator did what
only a dictator can do, and just made a damn decision already.
Thank you, Guido! =)
Yes, hear hear.
Sam wrote:
Jaime Wyant writes:
On 9/30/05, Sam [EMAIL PROTECTED] wrote:
Reinhold Birkenfeld writes:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of
Python
there will be a conditional expression with the following syntax:
X if C else Y
which
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
or
C and X or Y (only if X is True)
Reinhold
--
Fredrik Lundh wrote:
Reinhold Birkenfeld wrote:
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
which is the same as today's
(Y, X)[bool(C)]
hopefully, only one of Y or X
pnm wrote:
I have a standard Debian x86 system with Python 2.4.1 (compiled from
source). Attempts to compile 2.4.2 fail with references to Unicode --
is there a basic system library that's missing?
++ output from make:
libpython2.4.a(funcobject.o)(.text+0x96): In function
Rocco Moretti wrote:
Reinhold Birkenfeld wrote:
Hi,
after Guido's pronouncement yesterday, in one of the next versions of Python
there will be a conditional expression with the following syntax:
X if C else Y
Any word on chaining?
That is, what would happen with the following
Pierre Barbier de Reuille wrote:
So, what I would suggest is to drop the user-defined augmented
assignment and to ensure this equivalence :
a X= b = a = a X b
with 'X' begin one of the operators.
It can be done, but it's unnecessary for mutable objects like
sets or lists. A new object
Kenneth McDonald wrote:
I have a module I'd like to document using the same style...
The Python Library documentation is written in LaTeX and converted to
HTML with latex2html. The relevant style and source files are in the
Python CVS tree.
Reinhold
--
Rainer Hubovsky wrote:
Thank you Reinhold, that was the solution. But just because I am curious:
what is this statement without the parentheses? After all it is a valid
statement...
Rainer
In article [EMAIL PROTECTED], Reinhold Birkenfeld wrote:
Is the above exactly your code? If yes
Peter Hansen wrote:
Tor Erik Sønvisen wrote:
How can I determine the type of a socket (TCP or UDP) object?
In what context? Do you have some code that gets passed a socket object
but it could have been created with either SOCK_STREAM or SOCK_DGRAM?
And you want a way of determining by
D H wrote:
Igor V. Rafienko wrote:
This gave me the desired behaviour, but:
* It looks *very* ugly
* It's twice as slow as version which sees 'end'-events only.
Now, there *has* to be a better way. What am I missing?
Try emailing the author for support.
I don't think that's needed.
D H wrote:
Reinhold Birkenfeld wrote:
D H wrote:
Igor V. Rafienko wrote:
This gave me the desired behaviour, but:
* It looks *very* ugly
* It's twice as slow as version which sees 'end'-events only.
Now, there *has* to be a better way. What am I missing?
Try emailing the author
D H wrote:
Reinhold Birkenfeld wrote:
Well, if I had e.g. a question about Boo, I would of course first ask
here because I know the expert writes here.
Reinhold
Reinhold Birkenfeld also wrote:
If I had wanted to say you have opinions? fuck off!, I would have said
you have
D H wrote:
D H wrote:
Reinhold Birkenfeld wrote:
Well, if I had e.g. a question about Boo, I would of course first ask
here because I know the expert writes here.
Reinhold
Reinhold Birkenfeld also wrote:
If I had wanted to say you have opinions? fuck off!, I would have said
you
Jason wrote:
A week ago I posted a simple little hi-score routine that I was using to
learn Python.
I've only just managed to examine the code, and the responses that
people gave, and I'm now seriously struggling to understand why things
aren't working correctly.
At present my code is
D H wrote:
Reinhold Birkenfeld wrote:
D H wrote:
D H wrote:
Reinhold Birkenfeld wrote:
Well, if I had e.g. a question about Boo, I would of course first ask
here because I know the expert writes here.
Reinhold
Reinhold Birkenfeld also wrote:
If I had wanted to say you have opinions
Paul Boddie wrote:
Reinhold Birkenfeld wrote:
D H wrote:
I would recommend emailing the author of a library when you have a
question about that library. You should know that yourself as well.
Well, if I had e.g. a question about Boo, I would of course first ask
here because I know
Rainer Hubovsky wrote:
Hello Python-Gurus,
==
f = open(LOGFILE,'w')
f.write(time + '\n')
f.close
command = 'ping -n 20' + target + '' + LOGFILE
system(command)
==
produces an error saying that a file cannot be accessed because it is
Jason wrote:
Rather than reply to those individuals, just a big thanks to those
that have helped.
It's definitely making sense, the fact that I need to show the
two-element tuple to show correctly was one of those head-slapping moments.
And Dennis Lee Bieber hit the nail on the head
Erik Wilsher wrote:
Python developement is discussed, decided and usually developed within
the members of python-dev. Have you seen any discussions about
xml-literals in python-dev lately?
No. I don't need them, so I don't start a discussion. If you need them, or
you want them, feel free to
Fredrik Lundh wrote:
Reinhold Birkenfeld wrote:
And I think the discussion that followed proved your point perfectly
Fredrik. Big discussion over fairly minor things, but no big picture.
Where are the initiatives on the big stuff (common documentation
format, improved build system
ago wrote:
Is it possible to have a default value associated python objects? I.e.
to flag an attribute in such a way that the assignment operator for the
object returns the default attribute instead of the object itself, but
calls to other object attributes are properly resolved? (I don't
Erik Wilsher wrote:
And I think the discussion that followed proved your point perfectly
Fredrik. Big discussion over fairly minor things, but no big picture.
Where are the initiatives on the big stuff (common documentation
format, improved build system, improved web modules, reworking the
Florian Lindner wrote:
Hello,
is there a python lib (preferably in the std lib) to monitor a directory for
changes (adding / deleting files) for Linux 2.6?
There isn't, but if you don't want to use dnotify/inotify, it is trivial to
implement: use a timer and check the listdir() return value.
[EMAIL PROTECTED] wrote:
rs='AUGCUAGACGUGGAGUAG'
rs[12:15]='GAG'
Traceback (most recent call last):
File pyshell#119, line 1, in ?
rs[12:15]='GAG'
TypeError: object doesn't support slice assignment
You can't assign to a section of a sliced string in
Python 2.3 and there doesn't
Grant Edwards wrote:
I give up, how do I make this not fail under 2.4?
fcntl.ioctl(self.dev.fileno(),0xc0047a80,struct.pack(HBB,0x1c,0x00,0x00))
I get an OverflowError: long int too large to convert to int
ioctl() is expecting a 32-bit integer value, and 0xc0047a80 has
the high-order
David Wilson wrote:
For the most part, CPython performs few optimisations by itself. You
may be interested in psyco, which performs several heavy optimisations
on running Python code.
http://psyco.sf.net/
Defining a function inside a loop in CPython will cause a new function
object to be
Irmen de Jong wrote:
Michael Hoffman wrote:
Lonnie Princehouse wrote:
C:\python -u
Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)]
on win32
Type help, copyright, credits or license for more information.
print 'hello'
File stdin, line 1
print 'hello'
n00m wrote:
Tim Peters wrote:
The chance that Raymond Hettinger is going to recode _your_
functions in C is approximately 0 ;-)
Who is Raymond Hettinger?
See python-dev and, wrt this thread,
http://docs.python.org/whatsnew/node12.html.
Reinhold
--
n00m wrote:
Got it! He is a kind of pythonic monsters.
Btw, why it's impossible to reply to old threads?
Namely, there're no more Reply link in them.
Only Reply to author etc.
Perhaps because you are not using a real Usenet client?
Reinhold
--
Robert Kern wrote:
Grant Edwards wrote:
On 2005-09-14, Robert Kern [EMAIL PROTECTED] wrote:
Antoon Pardon wrote:
0.0225 isn't representable and it happens that the actual number
you get differ. Now which number python should choose when it is
fed 0.0225, I don't know. But expressing the
Terry Hancock wrote:
On Monday 12 September 2005 10:09 pm, [EMAIL PROTECTED] wrote:
I like to keep my classes each in a separate file with the same name of
the class. The problem with that is that I end up with multiple imports
in the beginning of each file, like this:
from foo.Bar import
tiissa wrote:
bill wrote:
From 3.2 in the Reference Manual The Standard Type Hierarchy:
Integers
These represent elements from the mathematical set of whole
numbers.
The generally recognized definition of a 'whole number' is zero and the
positive integers.
This term is ambiguous
Michael Hoffman wrote:
Andrew MacKeith wrote:
In the C API Docs, the signature of PyBool from long seems to be incorrect.
int PyBool_FromLong(long v)
Returns Py_True or Py_False depending on the truth value of v. New
in version 2.3.
The description would suggest:
PyObject*
Raymond Hettinger wrote:
John Machin wrote:
Looks like arrays are NOW (2.4.1) pickleable but not unpickleable
Please file a bug report and assign to me.
Done. http://python.org/sf/1281383
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Matt Hammond wrote:
Well, maybe it's right both ways ;-) I.e., even though yield is now
an expression, it is valid to use it as an expression-statement which
evaluates the expression and discards the value. So I think you could
still use the currently illegal yield in token sequence to mean
Terry Hancock wrote:
On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote:
The customary way is to use class new_class(object):. There's no advantage
in using
__metaclass__ except that you can set it globally for all classes in that
module
(which can be confusing on its own
Kay Schluehr wrote:
Reinhold Birkenfeld wrote:
x = [ yield r for r in iterable ]
Which is quite different from
x = (yield) in iterable
which is currently (PEP 342) equivalent to
_ = (yield)
x = _ in iterable
So, no further tinkering with yield, I'm afraid.
Reinhold
Steve Holden wrote:
Reinhold Birkenfeld wrote:
Terry Hancock wrote:
On Tuesday 30 August 2005 04:09 pm, Reinhold Birkenfeld wrote:
The customary way is to use class new_class(object):. There's no
advantage in using
__metaclass__ except that you can set it globally for all classes
Colin J. Williams wrote:
I recently heard about 'new-style classes'. I am very sorry if this
sounds like a newbie question, but what are they? I checked the Python
Manual but did not find anything conclusive. Could someone please
enlighten me? Thanks!
New style classes are becoming the standard
Bengt Richter wrote:
On Tue, 30 Aug 2005 12:18:59 GMT, Michael Hudson [EMAIL PROTECTED] wrote:
Talin [EMAIL PROTECTED] writes:
I'm finding that a lot of places within my code, I want to return the
output of a generator from another generator. Currently the only
method I know of to do this
Terry Hancock wrote:
On Sunday 28 August 2005 04:47 am, Vaibhav wrote:
I recently heard about 'new-style classes'. I am very sorry if this
sounds like a newbie question, but what are they? I checked the Python
Manual but did not find anything conclusive. Could someone please
enlighten me?
Michele Simionato wrote:
An easy question, but I don't find the answer in the docs :-(
I have a sqlite3 database containing accented characters (latin-1).
How do I set the right encoding? For instance if I do this:
I think you should ask on the pysqlite-devel list.
Reinhold
--
Hi,
I'm trying to get reportlab working together with the Tahoma font
(by Microsoft ;)
So far it's up and running (converted the ttf with ttf2pt1), but the
Euro sign (which is in position 0x80 in the WinAnsiEncoding) fails to
show up in the final PDF.
I investigated a bit and saw that in the
Reinhold Birkenfeld wrote:
Hi,
I'm trying to get reportlab working together with the Tahoma font
(by Microsoft ;)
So far it's up and running (converted the ttf with ttf2pt1), but the
Euro sign (which is in position 0x80 in the WinAnsiEncoding) fails to
show up in the final PDF.
I
Bryan Olson wrote:
Steve Holden wrote:
Bryan Olson wrote:
Antoon Pardon wrote:
It probably is too late now, but I always felt, find should
have returned None when the substring isn't found.
None is certainly a reasonable candidate.
[...]
The really broken part is that
Shaun wrote:
Hi,
I'm trying to overload the divide operator in python for basic arithmetic.
eg. 10/2 ... no classes involved.
I am attempting to redefine operator.__div__ as follows:
# my divide function
def safediv(a,b):
return ...
# reassign buildin
Yoav wrote:
Don't think it will do much good. I need to get them from a file and
extract the last folder in the path. For example:
if I get c:\dos\util
I want to extract the string \util
Then os.path.basename should be for you.
Reinhold
--
rafi wrote:
Adriaan Renting wrote:
You might be able to do something along the lines of
for count in range(0,maxcount):
value = values[count]
exec(eval('a%s=%s' % (count, value)))
why using the eval?
exec ('a%s=%s' % (count, value))
should be fine
And this demonstrates why
John Machin wrote:
... AND it's about time that list is updated to include False explicitly
-- save nitpicking arguments about whether False is covered by
numeric zero of all types :-)
Done.
If I try:
f = open(blah.txt, r)
while (c = f.read(1)) != '':
# ... work on c
I
Dan wrote:
http://www.python.org/doc/2.4.1/lib/node110.html
These methods are being deprecated. What are they being replaced
with?
They're being made methods of the string class itself.
For example:
s = 'any old string'
string.split(s, ' ') # Old way
['any', 'old',
Rex Eastbourne wrote:
Thanks. I adapted it a bit:
def debug(foo):
print foo, 'is:'
exec('pprint.pprint(' + foo + ')')
But I'm getting NameError: name 'foo' is not defined, since foo is
not defined in this scope. (The function works beautifully when I'm
dealing with global
Evil Bastard wrote:
bruno modulix wrote:
You can tell buy the most common use. bash is a scripting language,
javascript is a scripting language, perl is a scripting language, php is
a scripting language, Python is *not* a scripting language !-)
Perhaps a better definition - the term
could ildg wrote:
I want to check if a folder named foldername is empty.
I use os.listdir(foldername)==[] to do this,
but it will be very slow if the folder has a lot of sub-files.
Is there any efficient ways to do this?
try:
os.rmdir(path)
empty = True
except OSError:
empty =
Al Christians wrote:
EP wrote:
yes, my apologies to all things Iron and or Python.
language and version can be confusing if one stays up late without
coffee, or perhaps if one has not been debugging their English code properly.
Still, it's a bit of a PITB to me that it says XP and
Erik the Red wrote:
So, I did the following:
---
a=input(Give me an integer)
b=input(Give me another integer)
def gcd(a,b):
if a b:
a, b = b, a
while b != 0:
a, b = b, a % b
return a
---
But, in the xterm, it terminates after Give me another integer.
Kay Schluehr wrote:
No good news for scripting-language fans:
http://www.phpmag.net/itr/news/psecom,id,23284,nodeid,113.html
The study was conducted by Evans Data Corporation. Look here:
http://www.evansdata.com/n2/about_us_clients.shtml
Do you see the PSF or Larry Wall on the list?
Erik Max Francis wrote:
Daniel Schüle wrote:
maybe I confuse, in german one would say 45 Grad
I took a freedom to translate it directly :)
well, my calculator shows a D
which most likely stands for Degree, I cannot tell for sure
Probably. In English, you have degrees and gradians, which
Terry Reedy wrote:
[EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
Hi,
on startup my embedded python comes up with import site failed use
-v. Later python crashes on Pyrun_file(). This is the first time I
have used python and I would like to know does it require site.py to be
Bob Greschke wrote:
Looks like the label system command will do it in Windows. That's good
enough for this exercise. So, in Linux...???
mlabel in the mtools package will do what you need. mkfs.vfat can also
be given a volume label, but it will not allow you to set the label without
creating
Delaney, Timothy (Tim) wrote:
Peter Hansen wrote:
Change those to raise NotImplementedError('blah') instead and you'll
be taking the more idiomatic approach.
One thing I've noticed, which I may raise on python-dev ...
NotImplementedError does *not* play well with super() ...
class A
phil hunt wrote:
On Sun, 31 Jul 2005 09:48:45 +0200, Reinhold Birkenfeld [EMAIL PROTECTED]
wrote:
An improvement to what? To how the class is implemented, or to how
it is used?
No, the second function is cleaner and more readable than the first,
IMHO.
True, but the first function
phil hunt wrote:
On Sun, 31 Jul 2005 12:09:48 -0700, Cliff Wells [EMAIL PROTECTED] wrote:
On Sun, 2005-07-31 at 10:07 -0700, Kay Schluehr wrote:
Some other people already abandoned Python not for the worst reasons:
http://www.kevin-walzer.com/pivot/entry.php?id=69
Being a developer requires
Franz Steinhaeusler wrote:
The background:
I want to create a code completition for an editor component.
It should distinguish between inherited and non inherited members.
Reason is, that on wxPython, most classes are derived from wxWindow.
For example if I want Code completition for
Kay Schluehr wrote:
Reinhold Birkenfeld wrote:
In practise any Python GUI is going to contain code from otyher
languages since if it was coded all the way down in python it would
be too slow.
Oh, I could imagine that a MFC-like wrapper around win32gui, or another
one around Xlib
phil hunt wrote:
On Sat, 30 Jul 2005 19:01:49 +0200, Reinhold Birkenfeld [EMAIL PROTECTED]
wrote:
phil hunt wrote:
def normalizePath(p, *pathParts):
Normalize a file path, by expanding the user name and getting
the absolute path..
@param p [string] = a path to a file
NickC wrote:
[Re: alternatives to overloading '/']
Is there a reason the Path constructor is limited to a single argument?
If it allowed multiple arguments, the following would seem very
straightforward:
p = Path(somePath, user.getFolder(), 'archive', oldPath + .bak)
That's a quite good
Ivan Van Laningham wrote:
Hi All--
Tony Meyer wrote:
So far, there have been various statements that look like +0 for __div__,
but no-one with a +1. (And I've said this a couple of times now, which
really is just trolling for a +1 from someone).
It's not a question of saving
Mike Orr wrote:
The main changes I'd like to see in Path (some of these have been made
in Python CVS at nondist/sandbox/path/path.py) are:
Thanks for the comments! They are greatly appreciated.
- When methods create path objects, use self.__class__() instead of
Path().
This makes it
NickC wrote:
[Re: how to get at the base class]
Do you really want to have a only works for Path way to get at the
base class, rather than using the canonical Path.__bases__[0]?
How about a new property in the os.path module instead? Something like
os.path.path_type.
Then
Stefan Rank wrote:
on 30.07.2005 10:20 Paolino said the following:
why (x**2 with(x))(x**3 with(x)) is not taken in consideration?
If 'with' must be there (and substitue 'lambda:') then at least the
syntax is clear.IMO Ruby syntax is also clear.
I am sorry if this has already been
Steven D'Aprano wrote:
On Sat, 30 Jul 2005 08:13:26 -0400, Peter Hansen wrote:
Beginners should not be comparing lambdas.
Neither should you. ;-)
Actually, yes I should, because I'm trying to make sense of the mess that
is Python's handling of comparisons. At least two difference senses
phil hunt wrote:
On Fri, 29 Jul 2005 14:38:23 +1200, Tony Meyer [EMAIL PROTECTED] wrote:
def functions_which_modifies_some_file_in_place(path):
output = open(path+'.tmp', 'w')
.
I dont want a seperator inserted between path and the new extension.
Fair enough. Forget using '+' for
phil hunt wrote:
def normalizePath(p, *pathParts):
Normalize a file path, by expanding the user name and getting
the absolute path..
@param p [string] = a path to a file or directory
@param pathParts [list of string] = optional path parts
@return [string] = the same path,
Steven D'Aprano wrote:
On Sat, 30 Jul 2005 14:10:52 +0200, Reinhold Birkenfeld wrote:
Above all, nobody can tell me that there's any programmer who doesn't
instantly recognize '/' as a directory separator.
Is classic Macintosh OS still supported on Python? Because Mac programmers
who
Georg Neis wrote:
* Reinhold Birkenfeld [EMAIL PROTECTED] wrote:
Steven D'Aprano wrote:
1+0j == 1 0
True
(1+0j == 1) yields True, which is comparable to 0.
a == b c is equivalent to a == b and b c:
Right. Stupid me :) Doesn't do much to the point, though.
1 == 1+0j 0
Traceback
Steven D'Aprano wrote:
On Sat, 30 Jul 2005 15:32:45 +0200, Reinhold Birkenfeld wrote:
Um, I didn't ask to compare complex numbers using comparison operators. I
asked to sort a list. And please don't tell me that that sorting is
implemented with comparison operators. That just means
Michael Hoffman wrote:
Reinhold Birkenfeld wrote:
It's much the same as with @ decorators. Those who have used them much
don't object to the syntax any more.
I do and I still think they are ugly.
Shouldn't have generalized that. Add most of where you like.
Reinhold
--
http
Peter Hansen wrote:
Reinhold Birkenfeld wrote:
Mike Orr wrote:
- I saw in a thread that .name and .parent were removed. I use them
very frequently, along with .ext and .namebase. I don't want to call
methods for these.
They are now named .basename and .directory.
Reinhold, is .parent now
Michele Simionato wrote:
http://fuhm.org/super-harmful/
That is a pretty good page; I must say that my position is more radical
(i.e. it is not super which
is harmful, it is multiple inheritance itself that it is harmful: was I
going to design a new language
I would implement it *without*
flupke wrote:
Hi,
i have a property in a class that gets changed
and i would want to know who changes it.
Is there a way i can find out the calling function of a property?
You're looking for sys._getframe.
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Joe wrote:
Back in March I submitted a patch for cgi.py to sourceforge to fix a problem
with the handling of an invalid REQUEST_METHOD.
I thought I followed all the steps to properly submit the bug and patch but
the patch is still sitting there in limbo.
This is the first patch I have
Tony Meyer wrote:
[...]
Open issues:
[...]
What about path * 4?
If you keep the current join meaning of __div__, then assigning any sort of
multiplication meaning to __mul__ would not be a good idea, IMO. It's
natural to expect that __div__ and __mul__ are opposites. I suppose this
Andrew Dalke wrote:
Reinhold Birkenfeld wrote:
Okay. While a path has its clear use cases and those don't need above
methods,
it may be that some brain-dead functions needs them.
brain-dead?
Consider this code, which I think is not atypical.
Okay, convinced.
Reinhold
--
http
Reinhold Birkenfeld wrote:
Hi,
the arguments in the previous thread were convincing enough, so I made the
Path class inherit from str/unicode again.
Current change:
* Add base() method for converting to str/unicode.
* Allow compare against normal strings.
Reinhold
--
http
Stefan Rank wrote:
on 25.07.2005 10:44 Michael Hoffman said the following:
Reinhold Birkenfeld wrote:
Tony Meyer wrote:
Do people really like using __div__ to mean join?
Of course, one can use joinwith() if he doesn't like '/'.
Personally, I'm -0 on __div__, but I suppose if anyone here claimed
Michael Hoffman wrote:
Currently it returns Path('None'). This means I have to do a check on
input before pathifying it to make sure it is not None.
Perhaps it should throw ValueError?
The problem is that Path() currently acts like str() and will therefore
accept almost anything that has a
Peter Hansen wrote:
Reinhold Birkenfeld wrote:
Peter Hansen wrote:
Would basestring() be a better name?
tobase?
tostring?
tobasestring?
Of these choices, the latter would be preferable.
Alternative is to set a class attribute Base of the
Path class. Or export PathBase
Peter Hansen wrote:
Michael Hoffman wrote:
Currently it returns Path('None'). This means I have to do a check on
input before pathifying it to make sure it is not None.
Perhaps it should throw ValueError?
Without checking, I suspect it is merely doing str(x) or unicode(x) on
whatever
[EMAIL PROTECTED] wrote:
Reinhold Right, that was a concern of mine, too.
Reinhold tobase?
Reinhold tostring?
Reinhold tobasestring?
If we're on a filesystem that understands unicode, would somepath.tostring()
return a unicode object or a string object encoded with some
Bengt Richter wrote:
BTW, more OT, wouldn't '|' be more platform-neutral as the joining operator?
I, on the other hand, would certainly prefer U+01C1.
Reinhold
--
http://mail.python.org/mailman/listinfo/python-list
Peter Hansen wrote:
Reinhold Birkenfeld wrote:
[on comparing Paths and stings]
Do you have a use case for the comparison? Paths should be compared only
with other paths.
I can think of lots, though I don't know that I've used any in my
existing (somewhat limited) code that uses Path
Reinhold Birkenfeld wrote:
Hi,
the arguments in the previous thread were convincing enough, so I made the
Path class inherit from str/unicode again.
Further changes by now:
* subdirs() is now dirs().
* fixed compare behaviour for unicode base (unicode has no rich compare)
* __iter__
Michael Hoffman wrote:
Reinhold Birkenfeld wrote:
* __iter__() iterates over the parts().
* the following methods raise NotImplemented:
capitalize, expandtabs, join, splitlines, title, zfill
Why? They *are* implemented. I do not understand this desire to wantonly
break basestring
Peter Hansen wrote:
Reinhold Birkenfeld wrote:
Peter Hansen wrote:
if mypath.splitpath()[0] == 'c:/temp':
vs.
if mypath.splitpath()[0] == Path('c:/temp'):
But you must admit that that't the cleaner solution.
Cleaner? Not at all. I'd say it's the more expressive solution
John Machin wrote:
Reinhold Birkenfeld wrote:
Berthold Höllmann wrote:
Francois De Serres [EMAIL PROTECTED] writes:
hiho,
what's the clean way to translate the tuple (0x73, 0x70, 0x61, 0x6D)
to the string 'spam'?
. t = (0x73, 0x70, 0x61, 0x6D)
. ''.join('%c' % c for c in t)
'spam
Hi,
the arguments in the previous thread were convincing enough, so I made the
Path class inherit from str/unicode again.
It still can be found in CVS:
/python/nondist/sandbox/path/{path.py,test_path.py}
One thing is still different, though: a Path instance won't compare to a regular
string.
1 - 100 of 227 matches
Mail list logo