On Thursday 09 August 2007 00:22:51 Christian Heimes wrote:
> Hey Pythonistas!
>
> Victor Stinner just made a good point at #python. The py3k has no magic
> method and type slot for bytes.

And another problem: mix of __str__ and __unicode__ methods.

class A:
  def __str__(self): return '__str__'

class B:
  def __str__(self): return '__str__'
  def __unicode__(self): return '__unicode__'

print (repr(str( A() )))  # display '__str__'
print (repr(str( B() )))  # display '__unicode__'


Proposition:

  __str__() -> str (2.x) becomes __bytes__() -> bytes (3000)
  __unicode__() -> unicode (2.x) becomes __str__() -> str (3000)

Victor Stinner aka haypo
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to