Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Clarify difference between this and namedtuple on website #4

Open
cool-RR opened this issue Nov 16, 2014 · 4 comments
Open

Clarify difference between this and namedtuple on website #4

cool-RR opened this issue Nov 16, 2014 · 4 comments
Assignees
Milestone

Comments

@cool-RR
Copy link

cool-RR commented Nov 16, 2014

No description provided.

@gnarea
Copy link
Owner

gnarea commented Nov 16, 2014

Hi @cool-RR!

I did it in the Best Practices page, but now that you point it out, I think I should link to that entry from the homepage.

I'll do it later today.

Thank you!

@gnarea gnarea self-assigned this Nov 16, 2014
@cool-RR
Copy link
Author

cool-RR commented Nov 16, 2014

Haven't really explained what are the advantages over namedtuple, and why
an immutable record would be so superior to a namedtuple.

On Sun, Nov 16, 2014 at 2:07 PM, Gustavo Narea notifications@github.com
wrote:

Hi @cool-RR https://github.com/cool-RR!

I did it in the Best Practices page
https://pythonhosted.org/pyrecord/best-practices.html#use-the-right-data-type-for-the-job,
but now that you point it out, I think I should link to that entry from the
homepage.

I'll do it later today.

Thank you!


Reply to this email directly or view it on GitHub
#4 (comment).

@gnarea
Copy link
Owner

gnarea commented Nov 16, 2014

Right, I see what you mean.

I agree about the advantages over namedtuple not being explicitly stated. I'll improve that later today.

I'll explain it in the documentation later, but basically, the advantages boil down to:

  • Type inheritance support.
  • Support for optional fields with default values.
  • In my opinion, a cleaner and more Pythonic API (adherence to PEP-8 and the Zen of Python).

By the way, I don't think records are better than named tuples because the former are mutable. I think there's a place for mutable and immutable records, and I'll be adding support for immutable records in the future (see #3).

@gnarea
Copy link
Owner

gnarea commented Nov 19, 2014

Hi!

Just to give you an update: I started this, but could not finish it over the weekend.

I'll update this ticket when it's done.

Cheers :)

@gnarea gnarea modified the milestone: v1.1 Nov 3, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants