Mercurial > public > mercurial-scm > hg
comparison mercurial/util.py @ 43506:9f70512ae2cf
cleanup: remove pointless r-prefixes on single-quoted strings
This is the promised second step on single-quoted strings. These had
existed because our source transformer didn't turn r'' into b'', so we
had tagged some strings as r-strings to get "native" strings on both
Pythons. Now that the transformer is gone, we can dispense with this
nonsense.
Methodology:
I ran
hg locate 'set:added() or modified() or clean()' | egrep '.*\.py$' | xargs egrep --color=never -n -- \[\^b\]\[\^a-z\]r\'\[\^\'\\\\\]\*\'\[\^\'\
in an emacs grep-mode buffer, and then used a keyboard macro to
iterate over the results and remove the r prefix as needed.
# skip-blame removing unneeded r prefixes left over from Python 3 migration.
Differential Revision: https://phab.mercurial-scm.org/D7306
author | Augie Fackler <augie@google.com> |
---|---|
date | Fri, 08 Nov 2019 11:19:20 -0800 |
parents | 5d40317d42b7 |
children | c21aca51b392 |
comparison
equal
deleted
inserted
replaced
43505:47fac1692ede | 43506:9f70512ae2cf |
---|---|
55 compression, | 55 compression, |
56 procutil, | 56 procutil, |
57 stringutil, | 57 stringutil, |
58 ) | 58 ) |
59 | 59 |
60 rustdirs = policy.importrust(r'dirstate', r'Dirs') | 60 rustdirs = policy.importrust('dirstate', 'Dirs') |
61 | 61 |
62 base85 = policy.importmod(r'base85') | 62 base85 = policy.importmod('base85') |
63 osutil = policy.importmod(r'osutil') | 63 osutil = policy.importmod('osutil') |
64 parsers = policy.importmod(r'parsers') | 64 parsers = policy.importmod('parsers') |
65 | 65 |
66 b85decode = base85.b85decode | 66 b85decode = base85.b85decode |
67 b85encode = base85.b85encode | 67 b85encode = base85.b85encode |
68 | 68 |
69 cookielib = pycompat.cookielib | 69 cookielib = pycompat.cookielib |
163 # | 163 # |
164 # The option of setting PYTHONWARNINGS in the test runner was investigated. | 164 # The option of setting PYTHONWARNINGS in the test runner was investigated. |
165 # However, module name set through PYTHONWARNINGS was exactly matched, so | 165 # However, module name set through PYTHONWARNINGS was exactly matched, so |
166 # we cannot set 'mercurial' and have it match eg: 'mercurial.scmutil'. This | 166 # we cannot set 'mercurial' and have it match eg: 'mercurial.scmutil'. This |
167 # makes the whole PYTHONWARNINGS thing useless for our usecase. | 167 # makes the whole PYTHONWARNINGS thing useless for our usecase. |
168 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'mercurial') | 168 warnings.filterwarnings('default', '', DeprecationWarning, 'mercurial') |
169 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext') | 169 warnings.filterwarnings('default', '', DeprecationWarning, 'hgext') |
170 warnings.filterwarnings(r'default', r'', DeprecationWarning, r'hgext3rd') | 170 warnings.filterwarnings('default', '', DeprecationWarning, 'hgext3rd') |
171 if _dowarn and pycompat.ispy3: | 171 if _dowarn and pycompat.ispy3: |
172 # silence warning emitted by passing user string to re.sub() | 172 # silence warning emitted by passing user string to re.sub() |
173 warnings.filterwarnings( | 173 warnings.filterwarnings( |
174 r'ignore', r'bad escape', DeprecationWarning, r'mercurial' | 174 'ignore', 'bad escape', DeprecationWarning, 'mercurial' |
175 ) | 175 ) |
176 warnings.filterwarnings( | 176 warnings.filterwarnings( |
177 r'ignore', r'invalid escape sequence', DeprecationWarning, r'mercurial' | 177 'ignore', 'invalid escape sequence', DeprecationWarning, 'mercurial' |
178 ) | 178 ) |
179 # TODO: reinvent imp.is_frozen() | 179 # TODO: reinvent imp.is_frozen() |
180 warnings.filterwarnings( | 180 warnings.filterwarnings( |
181 r'ignore', | 181 'ignore', |
182 r'the imp module is deprecated', | 182 'the imp module is deprecated', |
183 DeprecationWarning, | 183 DeprecationWarning, |
184 r'mercurial', | 184 'mercurial', |
185 ) | 185 ) |
186 | 186 |
187 | 187 |
188 def nouideprecwarn(msg, version, stacklevel=1): | 188 def nouideprecwarn(msg, version, stacklevel=1): |
189 """Issue an python native deprecation warning | 189 """Issue an python native deprecation warning |
436 This type is intended to only be used for testing purposes. Think hard | 436 This type is intended to only be used for testing purposes. Think hard |
437 before using it in important code. | 437 before using it in important code. |
438 """ | 438 """ |
439 | 439 |
440 __slots__ = ( | 440 __slots__ = ( |
441 r'_orig', | 441 '_orig', |
442 r'_observer', | 442 '_observer', |
443 ) | 443 ) |
444 | 444 |
445 def __init__(self, fh, observer): | 445 def __init__(self, fh, observer): |
446 object.__setattr__(self, r'_orig', fh) | 446 object.__setattr__(self, '_orig', fh) |
447 object.__setattr__(self, r'_observer', observer) | 447 object.__setattr__(self, '_observer', observer) |
448 | 448 |
449 def __getattribute__(self, name): | 449 def __getattribute__(self, name): |
450 ours = { | 450 ours = { |
451 r'_observer', | 451 '_observer', |
452 # IOBase | 452 # IOBase |
453 r'close', | 453 'close', |
454 # closed if a property | 454 # closed if a property |
455 r'fileno', | 455 'fileno', |
456 r'flush', | 456 'flush', |
457 r'isatty', | 457 'isatty', |
458 r'readable', | 458 'readable', |
459 r'readline', | 459 'readline', |
460 r'readlines', | 460 'readlines', |
461 r'seek', | 461 'seek', |
462 r'seekable', | 462 'seekable', |
463 r'tell', | 463 'tell', |
464 r'truncate', | 464 'truncate', |
465 r'writable', | 465 'writable', |
466 r'writelines', | 466 'writelines', |
467 # RawIOBase | 467 # RawIOBase |
468 r'read', | 468 'read', |
469 r'readall', | 469 'readall', |
470 r'readinto', | 470 'readinto', |
471 r'write', | 471 'write', |
472 # BufferedIOBase | 472 # BufferedIOBase |
473 # raw is a property | 473 # raw is a property |
474 r'detach', | 474 'detach', |
475 # read defined above | 475 # read defined above |
476 r'read1', | 476 'read1', |
477 # readinto defined above | 477 # readinto defined above |
478 # write defined above | 478 # write defined above |
479 } | 479 } |
480 | 480 |
481 # We only observe some methods. | 481 # We only observe some methods. |
482 if name in ours: | 482 if name in ours: |
483 return object.__getattribute__(self, name) | 483 return object.__getattribute__(self, name) |
484 | 484 |
485 return getattr(object.__getattribute__(self, r'_orig'), name) | 485 return getattr(object.__getattribute__(self, '_orig'), name) |
486 | 486 |
487 def __nonzero__(self): | 487 def __nonzero__(self): |
488 return bool(object.__getattribute__(self, r'_orig')) | 488 return bool(object.__getattribute__(self, '_orig')) |
489 | 489 |
490 __bool__ = __nonzero__ | 490 __bool__ = __nonzero__ |
491 | 491 |
492 def __delattr__(self, name): | 492 def __delattr__(self, name): |
493 return delattr(object.__getattribute__(self, r'_orig'), name) | 493 return delattr(object.__getattribute__(self, '_orig'), name) |
494 | 494 |
495 def __setattr__(self, name, value): | 495 def __setattr__(self, name, value): |
496 return setattr(object.__getattribute__(self, r'_orig'), name, value) | 496 return setattr(object.__getattribute__(self, '_orig'), name, value) |
497 | 497 |
498 def __iter__(self): | 498 def __iter__(self): |
499 return object.__getattribute__(self, r'_orig').__iter__() | 499 return object.__getattribute__(self, '_orig').__iter__() |
500 | 500 |
501 def _observedcall(self, name, *args, **kwargs): | 501 def _observedcall(self, name, *args, **kwargs): |
502 # Call the original object. | 502 # Call the original object. |
503 orig = object.__getattribute__(self, r'_orig') | 503 orig = object.__getattribute__(self, '_orig') |
504 res = getattr(orig, name)(*args, **kwargs) | 504 res = getattr(orig, name)(*args, **kwargs) |
505 | 505 |
506 # Call a method on the observer of the same name with arguments | 506 # Call a method on the observer of the same name with arguments |
507 # so it can react, log, etc. | 507 # so it can react, log, etc. |
508 observer = object.__getattribute__(self, r'_observer') | 508 observer = object.__getattribute__(self, '_observer') |
509 fn = getattr(observer, name, None) | 509 fn = getattr(observer, name, None) |
510 if fn: | 510 if fn: |
511 fn(res, *args, **kwargs) | 511 fn(res, *args, **kwargs) |
512 | 512 |
513 return res | 513 return res |
514 | 514 |
515 def close(self, *args, **kwargs): | 515 def close(self, *args, **kwargs): |
516 return object.__getattribute__(self, r'_observedcall')( | 516 return object.__getattribute__(self, '_observedcall')( |
517 r'close', *args, **kwargs | 517 'close', *args, **kwargs |
518 ) | 518 ) |
519 | 519 |
520 def fileno(self, *args, **kwargs): | 520 def fileno(self, *args, **kwargs): |
521 return object.__getattribute__(self, r'_observedcall')( | 521 return object.__getattribute__(self, '_observedcall')( |
522 r'fileno', *args, **kwargs | 522 'fileno', *args, **kwargs |
523 ) | 523 ) |
524 | 524 |
525 def flush(self, *args, **kwargs): | 525 def flush(self, *args, **kwargs): |
526 return object.__getattribute__(self, r'_observedcall')( | 526 return object.__getattribute__(self, '_observedcall')( |
527 r'flush', *args, **kwargs | 527 'flush', *args, **kwargs |
528 ) | 528 ) |
529 | 529 |
530 def isatty(self, *args, **kwargs): | 530 def isatty(self, *args, **kwargs): |
531 return object.__getattribute__(self, r'_observedcall')( | 531 return object.__getattribute__(self, '_observedcall')( |
532 r'isatty', *args, **kwargs | 532 'isatty', *args, **kwargs |
533 ) | 533 ) |
534 | 534 |
535 def readable(self, *args, **kwargs): | 535 def readable(self, *args, **kwargs): |
536 return object.__getattribute__(self, r'_observedcall')( | 536 return object.__getattribute__(self, '_observedcall')( |
537 r'readable', *args, **kwargs | 537 'readable', *args, **kwargs |
538 ) | 538 ) |
539 | 539 |
540 def readline(self, *args, **kwargs): | 540 def readline(self, *args, **kwargs): |
541 return object.__getattribute__(self, r'_observedcall')( | 541 return object.__getattribute__(self, '_observedcall')( |
542 r'readline', *args, **kwargs | 542 'readline', *args, **kwargs |
543 ) | 543 ) |
544 | 544 |
545 def readlines(self, *args, **kwargs): | 545 def readlines(self, *args, **kwargs): |
546 return object.__getattribute__(self, r'_observedcall')( | 546 return object.__getattribute__(self, '_observedcall')( |
547 r'readlines', *args, **kwargs | 547 'readlines', *args, **kwargs |
548 ) | 548 ) |
549 | 549 |
550 def seek(self, *args, **kwargs): | 550 def seek(self, *args, **kwargs): |
551 return object.__getattribute__(self, r'_observedcall')( | 551 return object.__getattribute__(self, '_observedcall')( |
552 r'seek', *args, **kwargs | 552 'seek', *args, **kwargs |
553 ) | 553 ) |
554 | 554 |
555 def seekable(self, *args, **kwargs): | 555 def seekable(self, *args, **kwargs): |
556 return object.__getattribute__(self, r'_observedcall')( | 556 return object.__getattribute__(self, '_observedcall')( |
557 r'seekable', *args, **kwargs | 557 'seekable', *args, **kwargs |
558 ) | 558 ) |
559 | 559 |
560 def tell(self, *args, **kwargs): | 560 def tell(self, *args, **kwargs): |
561 return object.__getattribute__(self, r'_observedcall')( | 561 return object.__getattribute__(self, '_observedcall')( |
562 r'tell', *args, **kwargs | 562 'tell', *args, **kwargs |
563 ) | 563 ) |
564 | 564 |
565 def truncate(self, *args, **kwargs): | 565 def truncate(self, *args, **kwargs): |
566 return object.__getattribute__(self, r'_observedcall')( | 566 return object.__getattribute__(self, '_observedcall')( |
567 r'truncate', *args, **kwargs | 567 'truncate', *args, **kwargs |
568 ) | 568 ) |
569 | 569 |
570 def writable(self, *args, **kwargs): | 570 def writable(self, *args, **kwargs): |
571 return object.__getattribute__(self, r'_observedcall')( | 571 return object.__getattribute__(self, '_observedcall')( |
572 r'writable', *args, **kwargs | 572 'writable', *args, **kwargs |
573 ) | 573 ) |
574 | 574 |
575 def writelines(self, *args, **kwargs): | 575 def writelines(self, *args, **kwargs): |
576 return object.__getattribute__(self, r'_observedcall')( | 576 return object.__getattribute__(self, '_observedcall')( |
577 r'writelines', *args, **kwargs | 577 'writelines', *args, **kwargs |
578 ) | 578 ) |
579 | 579 |
580 def read(self, *args, **kwargs): | 580 def read(self, *args, **kwargs): |
581 return object.__getattribute__(self, r'_observedcall')( | 581 return object.__getattribute__(self, '_observedcall')( |
582 r'read', *args, **kwargs | 582 'read', *args, **kwargs |
583 ) | 583 ) |
584 | 584 |
585 def readall(self, *args, **kwargs): | 585 def readall(self, *args, **kwargs): |
586 return object.__getattribute__(self, r'_observedcall')( | 586 return object.__getattribute__(self, '_observedcall')( |
587 r'readall', *args, **kwargs | 587 'readall', *args, **kwargs |
588 ) | 588 ) |
589 | 589 |
590 def readinto(self, *args, **kwargs): | 590 def readinto(self, *args, **kwargs): |
591 return object.__getattribute__(self, r'_observedcall')( | 591 return object.__getattribute__(self, '_observedcall')( |
592 r'readinto', *args, **kwargs | 592 'readinto', *args, **kwargs |
593 ) | 593 ) |
594 | 594 |
595 def write(self, *args, **kwargs): | 595 def write(self, *args, **kwargs): |
596 return object.__getattribute__(self, r'_observedcall')( | 596 return object.__getattribute__(self, '_observedcall')( |
597 r'write', *args, **kwargs | 597 'write', *args, **kwargs |
598 ) | 598 ) |
599 | 599 |
600 def detach(self, *args, **kwargs): | 600 def detach(self, *args, **kwargs): |
601 return object.__getattribute__(self, r'_observedcall')( | 601 return object.__getattribute__(self, '_observedcall')( |
602 r'detach', *args, **kwargs | 602 'detach', *args, **kwargs |
603 ) | 603 ) |
604 | 604 |
605 def read1(self, *args, **kwargs): | 605 def read1(self, *args, **kwargs): |
606 return object.__getattribute__(self, r'_observedcall')( | 606 return object.__getattribute__(self, '_observedcall')( |
607 r'read1', *args, **kwargs | 607 'read1', *args, **kwargs |
608 ) | 608 ) |
609 | 609 |
610 | 610 |
611 class observedbufferedinputpipe(bufferedinputpipe): | 611 class observedbufferedinputpipe(bufferedinputpipe): |
612 """A variation of bufferedinputpipe that is aware of fileobjectproxy. | 612 """A variation of bufferedinputpipe that is aware of fileobjectproxy. |
649 | 649 |
650 return res | 650 return res |
651 | 651 |
652 | 652 |
653 PROXIED_SOCKET_METHODS = { | 653 PROXIED_SOCKET_METHODS = { |
654 r'makefile', | 654 'makefile', |
655 r'recv', | 655 'recv', |
656 r'recvfrom', | 656 'recvfrom', |
657 r'recvfrom_into', | 657 'recvfrom_into', |
658 r'recv_into', | 658 'recv_into', |
659 r'send', | 659 'send', |
660 r'sendall', | 660 'sendall', |
661 r'sendto', | 661 'sendto', |
662 r'setblocking', | 662 'setblocking', |
663 r'settimeout', | 663 'settimeout', |
664 r'gettimeout', | 664 'gettimeout', |
665 r'setsockopt', | 665 'setsockopt', |
666 } | 666 } |
667 | 667 |
668 | 668 |
669 class socketproxy(object): | 669 class socketproxy(object): |
670 """A proxy around a socket that tells a watcher when events occur. | 670 """A proxy around a socket that tells a watcher when events occur. |
674 This type is intended to only be used for testing purposes. Think hard | 674 This type is intended to only be used for testing purposes. Think hard |
675 before using it in important code. | 675 before using it in important code. |
676 """ | 676 """ |
677 | 677 |
678 __slots__ = ( | 678 __slots__ = ( |
679 r'_orig', | 679 '_orig', |
680 r'_observer', | 680 '_observer', |
681 ) | 681 ) |
682 | 682 |
683 def __init__(self, sock, observer): | 683 def __init__(self, sock, observer): |
684 object.__setattr__(self, r'_orig', sock) | 684 object.__setattr__(self, '_orig', sock) |
685 object.__setattr__(self, r'_observer', observer) | 685 object.__setattr__(self, '_observer', observer) |
686 | 686 |
687 def __getattribute__(self, name): | 687 def __getattribute__(self, name): |
688 if name in PROXIED_SOCKET_METHODS: | 688 if name in PROXIED_SOCKET_METHODS: |
689 return object.__getattribute__(self, name) | 689 return object.__getattribute__(self, name) |
690 | 690 |
691 return getattr(object.__getattribute__(self, r'_orig'), name) | 691 return getattr(object.__getattribute__(self, '_orig'), name) |
692 | 692 |
693 def __delattr__(self, name): | 693 def __delattr__(self, name): |
694 return delattr(object.__getattribute__(self, r'_orig'), name) | 694 return delattr(object.__getattribute__(self, '_orig'), name) |
695 | 695 |
696 def __setattr__(self, name, value): | 696 def __setattr__(self, name, value): |
697 return setattr(object.__getattribute__(self, r'_orig'), name, value) | 697 return setattr(object.__getattribute__(self, '_orig'), name, value) |
698 | 698 |
699 def __nonzero__(self): | 699 def __nonzero__(self): |
700 return bool(object.__getattribute__(self, r'_orig')) | 700 return bool(object.__getattribute__(self, '_orig')) |
701 | 701 |
702 __bool__ = __nonzero__ | 702 __bool__ = __nonzero__ |
703 | 703 |
704 def _observedcall(self, name, *args, **kwargs): | 704 def _observedcall(self, name, *args, **kwargs): |
705 # Call the original object. | 705 # Call the original object. |
706 orig = object.__getattribute__(self, r'_orig') | 706 orig = object.__getattribute__(self, '_orig') |
707 res = getattr(orig, name)(*args, **kwargs) | 707 res = getattr(orig, name)(*args, **kwargs) |
708 | 708 |
709 # Call a method on the observer of the same name with arguments | 709 # Call a method on the observer of the same name with arguments |
710 # so it can react, log, etc. | 710 # so it can react, log, etc. |
711 observer = object.__getattribute__(self, r'_observer') | 711 observer = object.__getattribute__(self, '_observer') |
712 fn = getattr(observer, name, None) | 712 fn = getattr(observer, name, None) |
713 if fn: | 713 if fn: |
714 fn(res, *args, **kwargs) | 714 fn(res, *args, **kwargs) |
715 | 715 |
716 return res | 716 return res |
717 | 717 |
718 def makefile(self, *args, **kwargs): | 718 def makefile(self, *args, **kwargs): |
719 res = object.__getattribute__(self, r'_observedcall')( | 719 res = object.__getattribute__(self, '_observedcall')( |
720 r'makefile', *args, **kwargs | 720 'makefile', *args, **kwargs |
721 ) | 721 ) |
722 | 722 |
723 # The file object may be used for I/O. So we turn it into a | 723 # The file object may be used for I/O. So we turn it into a |
724 # proxy using our observer. | 724 # proxy using our observer. |
725 observer = object.__getattribute__(self, r'_observer') | 725 observer = object.__getattribute__(self, '_observer') |
726 return makeloggingfileobject( | 726 return makeloggingfileobject( |
727 observer.fh, | 727 observer.fh, |
728 res, | 728 res, |
729 observer.name, | 729 observer.name, |
730 reads=observer.reads, | 730 reads=observer.reads, |
732 logdata=observer.logdata, | 732 logdata=observer.logdata, |
733 logdataapis=observer.logdataapis, | 733 logdataapis=observer.logdataapis, |
734 ) | 734 ) |
735 | 735 |
736 def recv(self, *args, **kwargs): | 736 def recv(self, *args, **kwargs): |
737 return object.__getattribute__(self, r'_observedcall')( | 737 return object.__getattribute__(self, '_observedcall')( |
738 r'recv', *args, **kwargs | 738 'recv', *args, **kwargs |
739 ) | 739 ) |
740 | 740 |
741 def recvfrom(self, *args, **kwargs): | 741 def recvfrom(self, *args, **kwargs): |
742 return object.__getattribute__(self, r'_observedcall')( | 742 return object.__getattribute__(self, '_observedcall')( |
743 r'recvfrom', *args, **kwargs | 743 'recvfrom', *args, **kwargs |
744 ) | 744 ) |
745 | 745 |
746 def recvfrom_into(self, *args, **kwargs): | 746 def recvfrom_into(self, *args, **kwargs): |
747 return object.__getattribute__(self, r'_observedcall')( | 747 return object.__getattribute__(self, '_observedcall')( |
748 r'recvfrom_into', *args, **kwargs | 748 'recvfrom_into', *args, **kwargs |
749 ) | 749 ) |
750 | 750 |
751 def recv_into(self, *args, **kwargs): | 751 def recv_into(self, *args, **kwargs): |
752 return object.__getattribute__(self, r'_observedcall')( | 752 return object.__getattribute__(self, '_observedcall')( |
753 r'recv_info', *args, **kwargs | 753 'recv_info', *args, **kwargs |
754 ) | 754 ) |
755 | 755 |
756 def send(self, *args, **kwargs): | 756 def send(self, *args, **kwargs): |
757 return object.__getattribute__(self, r'_observedcall')( | 757 return object.__getattribute__(self, '_observedcall')( |
758 r'send', *args, **kwargs | 758 'send', *args, **kwargs |
759 ) | 759 ) |
760 | 760 |
761 def sendall(self, *args, **kwargs): | 761 def sendall(self, *args, **kwargs): |
762 return object.__getattribute__(self, r'_observedcall')( | 762 return object.__getattribute__(self, '_observedcall')( |
763 r'sendall', *args, **kwargs | 763 'sendall', *args, **kwargs |
764 ) | 764 ) |
765 | 765 |
766 def sendto(self, *args, **kwargs): | 766 def sendto(self, *args, **kwargs): |
767 return object.__getattribute__(self, r'_observedcall')( | 767 return object.__getattribute__(self, '_observedcall')( |
768 r'sendto', *args, **kwargs | 768 'sendto', *args, **kwargs |
769 ) | 769 ) |
770 | 770 |
771 def setblocking(self, *args, **kwargs): | 771 def setblocking(self, *args, **kwargs): |
772 return object.__getattribute__(self, r'_observedcall')( | 772 return object.__getattribute__(self, '_observedcall')( |
773 r'setblocking', *args, **kwargs | 773 'setblocking', *args, **kwargs |
774 ) | 774 ) |
775 | 775 |
776 def settimeout(self, *args, **kwargs): | 776 def settimeout(self, *args, **kwargs): |
777 return object.__getattribute__(self, r'_observedcall')( | 777 return object.__getattribute__(self, '_observedcall')( |
778 r'settimeout', *args, **kwargs | 778 'settimeout', *args, **kwargs |
779 ) | 779 ) |
780 | 780 |
781 def gettimeout(self, *args, **kwargs): | 781 def gettimeout(self, *args, **kwargs): |
782 return object.__getattribute__(self, r'_observedcall')( | 782 return object.__getattribute__(self, '_observedcall')( |
783 r'gettimeout', *args, **kwargs | 783 'gettimeout', *args, **kwargs |
784 ) | 784 ) |
785 | 785 |
786 def setsockopt(self, *args, **kwargs): | 786 def setsockopt(self, *args, **kwargs): |
787 return object.__getattribute__(self, r'_observedcall')( | 787 return object.__getattribute__(self, '_observedcall')( |
788 r'setsockopt', *args, **kwargs | 788 'setsockopt', *args, **kwargs |
789 ) | 789 ) |
790 | 790 |
791 | 791 |
792 class baseproxyobserver(object): | 792 class baseproxyobserver(object): |
793 def _writedata(self, data): | 793 def _writedata(self, data): |
1360 | 1360 |
1361 Holds a reference to nodes on either side as well as a key-value | 1361 Holds a reference to nodes on either side as well as a key-value |
1362 pair for the dictionary entry. | 1362 pair for the dictionary entry. |
1363 """ | 1363 """ |
1364 | 1364 |
1365 __slots__ = (r'next', r'prev', r'key', r'value', r'cost') | 1365 __slots__ = ('next', 'prev', 'key', 'value', 'cost') |
1366 | 1366 |
1367 def __init__(self): | 1367 def __init__(self): |
1368 self.next = None | 1368 self.next = None |
1369 self.prev = None | 1369 self.prev = None |
1370 | 1370 |