CC: | |
Subject: | Stated guarantee that new() always returns the same object for a given name is not true. |
Date: | Wed, 14 Jul 2010 18:19:45 +0000 (GMT) |
To: | bug-datetime-timezone [...] rt.cpan.org |
From: | perl [...] galumph.com |
The description for the name() method reads: "Returns the name of the time zone. If this value is passed to the new() method, it is guaranteed to create the same object." This is not the case.
So is this a code or documentation bug? Maybe this should say "it is guaranteed to create the same class of object".
Interestingly, for me, the output of the following shows the same address for the first and third instances:
perl -MDateTime::TimeZone -MScalar::Util=refaddr -E 'say refaddr(DateTime::TimeZone->new(name => "UTC")) for 1..3'